Skip to content

Commit

Permalink
Merge pull request #229 from xiaoyaocz/dev
Browse files Browse the repository at this point in the history
Release 1.4.5
  • Loading branch information
xiaoyaocz authored Nov 7, 2023
2 parents 28cdf40 + 56b81dc commit cd4b94c
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_app_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Flutter action
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.6'
flutter-version: '3.13.9'
cache: true
#更新Flutter的packages
- name: Restore packages
Expand Down
6 changes: 3 additions & 3 deletions assets/app_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.4.4",
"version_num": 10404,
"version_desc": "- 优化聊天区使用体验 #52 #130 #139\n- 修复虎牙部分直播间观看一段时间后自动断开 #185\n- SC仅在哔哩哔哩平台显示\n- 修复全屏进入未直播的直播间无法返回问题 #205\n- 增加小窗时是否关闭弹幕选项\n- 房间内关注列表只显示开播房间 #183(#208 @AprDeci)\n- 添加自动关闭延迟弹窗 (#208 @AprDeci)\n- 哔哩哔哩支持登录账号,解决#209,#150\n\n桌面平台:\n- 鼠标侧键优先退出全屏 \n- esc退出全屏播放(#197 @AprDeci)\n- 添加桌面端鼠标滑动操控(#197 @AprDeci)\n- 支持音量调节 #147(#204 @AprDeci)\n- 桌面支持小窗(#204 @AprDeci)",
"version": "1.4.5",
"version_num": 10405,
"version_desc": "- 修复虎牙无法观看问题 #220\n- 修复手势提示不消失问题 #223\n- 刷新直播间不清空消息列表 #225\n- 增加动态取色/主题色选择(#213 @AprDeci)\n\n桌面平台:\n- 增加加载更多按钮 #228",
"prerelease":false,
"download_url": "https://github.com/xiaoyaocz/dart_simple_live/releases"
}
25 changes: 24 additions & 1 deletion simple_live_app/lib/app/controller/app_settings_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ class AppSettingsController extends GetxController {
pipHideDanmu.value = LocalStorageService.instance
.getValue(LocalStorageService.kPIPHideDanmu, true);

styleColor.value = LocalStorageService.instance
.getValue(LocalStorageService.kStyleColor, 0xff3498db);

isDynamic.value = LocalStorageService.instance
.getValue(LocalStorageService.kIsDynamic, false);



initSiteSort();
initHomeSort();
super.onInit();
Expand Down Expand Up @@ -307,4 +315,19 @@ class AppSettingsController extends GetxController {
pipHideDanmu.value = e;
LocalStorageService.instance.setValue(LocalStorageService.kPIPHideDanmu, e);
}
}


var styleColor = 0xff3498db.obs;
void setStyleColor(int e){
styleColor.value = e;
LocalStorageService.instance.setValue(LocalStorageService.kStyleColor, e);
}

var isDynamic = false.obs;
void setIsDynamic(bool e){
isDynamic.value = e;
LocalStorageService.instance.setValue(LocalStorageService.kIsDynamic, e);
}


}
22 changes: 18 additions & 4 deletions simple_live_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'package:simple_live_app/services/db_service.dart';
import 'package:simple_live_app/services/local_storage_service.dart';
import 'package:simple_live_app/widgets/status/app_loadding_widget.dart';
import 'package:simple_live_core/simple_live_core.dart';
import 'package:dynamic_color/dynamic_color.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand Down Expand Up @@ -85,11 +86,23 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
bool isDynamicColor = Get.find<AppSettingsController>().isDynamic.value;
Color styleColor = Color(Get.find<AppSettingsController>().styleColor.value);
return DynamicColorBuilder(
builder: ((ColorScheme?lightDynamic,ColorScheme?darkDynamic) {
ColorScheme? lightColorScheme;
ColorScheme? darkColorScheme;
if(lightDynamic!=null&&darkDynamic!=null&&isDynamicColor) {
lightColorScheme = lightDynamic;
darkColorScheme = darkDynamic;
}else{
lightColorScheme = ColorScheme.fromSeed(seedColor: styleColor,brightness: Brightness.light,);
darkColorScheme = ColorScheme.fromSeed(seedColor: styleColor,brightness: Brightness.dark);
}
return GetMaterialApp(
title: "Simple Live",
theme: AppStyle.lightTheme,

darkTheme: AppStyle.darkTheme,
theme: AppStyle.lightTheme.copyWith(colorScheme: lightColorScheme),
darkTheme: AppStyle.darkTheme.copyWith(colorScheme: darkColorScheme),
themeMode:
ThemeMode.values[Get.find<AppSettingsController>().themeMode.value],
initialRoute: RoutePath.kIndex,
Expand Down Expand Up @@ -140,5 +153,6 @@ class MyApp extends StatelessWidget {
),
),
);
}
}));
}
}
11 changes: 3 additions & 8 deletions simple_live_app/lib/modules/live_room/live_room_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,8 @@ class LiveRoomController extends PlayerController {
exit(0);
});
autoExitTimer?.cancel();
var delay = await Utils.showAlertDialog(
"定时关闭已到时,是否延迟关闭?",
title: "延迟关闭",
confirm: "延迟",
cancel: "关闭",
selectable: true
);
var delay = await Utils.showAlertDialog("定时关闭已到时,是否延迟关闭?",
title: "延迟关闭", confirm: "延迟", cancel: "关闭", selectable: true);
if (delay) {
timer.cancel();
delayAutoExit.value = true;
Expand All @@ -163,7 +158,7 @@ class LiveRoomController extends PlayerController {
// 弹窗逻辑

void refreshRoom() {
messages.clear();
//messages.clear();
superChats.clear();
liveDanmaku.stop();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,9 @@ mixin PlayerGestureControlMixin
leftVerticalDrag = details.globalPosition.dx < Get.width / 2;

verticalDragging = true;

showGestureTip.value = true;
_currentVolume = await PerfectVolumeControl.volume;
_currentBrightness = await screenBrightness.current;
showGestureTip.value = true;
}

/// 竖向手势更新
Expand Down
166 changes: 166 additions & 0 deletions simple_live_app/lib/modules/user/appstyle_setting_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:remixicon/remixicon.dart';
import 'package:simple_live_app/app/app_style.dart';
import 'package:simple_live_app/app/controller/app_settings_controller.dart';

class AppstyleSettingPage extends GetView<AppSettingsController> {
const AppstyleSettingPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("主题设置"),
),
body: ListView(
padding: AppStyle.edgeInsetsV12,
children: [
ListTile(
leading: Icon(Get.isDarkMode ? Remix.moon_line : Remix.sun_line),
title: const Padding(
padding: AppStyle.edgeInsetsL8,
child: Text("显示主题"),
),
trailing: const Icon(
Icons.chevron_right,
color: Colors.grey,
),
contentPadding: AppStyle.edgeInsetsH24,
onTap: Get.find<AppSettingsController>().changeTheme,
),
Obx(
() => RadioListTile(
value: true,
groupValue: controller.isDynamic.value,
onChanged: (e) {
controller.setIsDynamic(e ?? true);
Get.forceAppUpdate();
},
title: const Text("动态取色"),
),
),
Obx(
() {
return RadioListTile(
value: false,
groupValue: controller.isDynamic.value,
onChanged: (e) {
controller.setIsDynamic(e ?? false);
Get.forceAppUpdate();
},
title: const Text("选定颜色"),
);
},
),
Divider(
indent: 12,
endIndent: 12,
color: Colors.grey.withOpacity(.1),
),
Obx(
() => AnimatedOpacity(
opacity: controller.isDynamic.value ? 0 : 1,
duration: 0.5.seconds,
child: const SizedBox(
width: double.infinity,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ColorBox(
color: Color(0xffEF5350),
name: '红色',
),
ColorBox(
color: Color(0xff3498db),
name: '蓝色',
),
ColorBox(
color: Color(0xffF06292),
name: '粉色',
),
ColorBox(
color: Color(0xff9575CD),
name: '紫色',
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ColorBox(
color: Color(0xff26C6DA),
name: '青色',
),
ColorBox(
color: Color(0xff26A69A),
name: '绿色',
),
ColorBox(
color: Color(0xffFFF176),
name: '黄色',
),
ColorBox(
color: Color(0xffFF9800),
name: '橙色',
),
],
)
],
),
),
),
),
],
),
);
}
}

class ColorBox extends GetView<AppSettingsController> {
final Color color;
final String name;

const ColorBox({super.key, required this.color, required this.name});

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
controller.setStyleColor(color.value);
Get.forceAppUpdate();
},
child: Column(
children: [
Obx(
() => Container(
width: 70.0,
height: 40.0,
margin: const EdgeInsets.only(
left: 7.0, right: 7.0, top: 7.0, bottom: 2.0),
decoration: BoxDecoration(
color: color, borderRadius: BorderRadius.circular(4.0)),
child: AnimatedOpacity(
opacity: controller.styleColor.value == color.value ? 1 : 0,
duration: 0.4.seconds,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0),
border: Border.all(color: Colors.black, width: 1),
),
child: const Icon(
Icons.check,
color: Colors.white,
),
),
),
),
),
Text(name)
],
),
);
}
}
10 changes: 5 additions & 5 deletions simple_live_app/lib/modules/user/user_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:remixicon/remixicon.dart';
import 'package:simple_live_app/app/app_style.dart';
import 'package:simple_live_app/app/controller/app_settings_controller.dart';
import 'package:simple_live_app/app/utils.dart';
import 'package:simple_live_app/routes/route_path.dart';
import 'package:url_launcher/url_launcher_string.dart';
Expand Down Expand Up @@ -113,14 +112,15 @@ class UserPage extends StatelessWidget {
context,
children: [
ListTile(
leading:
Icon(Get.isDarkMode ? Remix.moon_line : Remix.sun_line),
title: const Text("显示主题"),
leading: const Icon(Remix.moon_line),
title: const Text("外观设置"),
trailing: const Icon(
Icons.chevron_right,
color: Colors.grey,
),
onTap: Get.find<AppSettingsController>().changeTheme,
onTap: () {
Get.toNamed(RoutePath.kAppstyleSetting);
},
),
ListTile(
leading: const Icon(Remix.home_2_line),
Expand Down
6 changes: 6 additions & 0 deletions simple_live_app/lib/routes/app_pages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:simple_live_app/modules/user/account/bilibili/qr_login_controlle
import 'package:simple_live_app/modules/user/account/bilibili/qr_login_page.dart';
import 'package:simple_live_app/modules/user/account/bilibili/web_login_controller.dart';
import 'package:simple_live_app/modules/user/account/bilibili/web_login_page.dart';
import 'package:simple_live_app/modules/user/appstyle_setting_page.dart';
import 'package:simple_live_app/modules/user/auto_exit_settings_page.dart';
import 'package:simple_live_app/modules/user/danmu_settings_page.dart';
import 'package:simple_live_app/modules/user/danmu_shield/danmu_shield_controller.dart';
Expand Down Expand Up @@ -94,6 +95,11 @@ class AppPages {
name: RoutePath.kSettingsDanmu,
page: () => const DanmuSettingsPage(),
),
//外观设置
GetPage(
name: RoutePath.kAppstyleSetting,
page: () => const AppstyleSettingPage()
),
//播放设置
GetPage(
name: RoutePath.kSettingsPlay,
Expand Down
3 changes: 3 additions & 0 deletions simple_live_app/lib/routes/route_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class RoutePath {
/// 主页设置
static const kSettingsIndexed = "/settings/indexed";

/// 外观设置
static const kAppstyleSetting = "/settings/appstyle";

/// 账号管理
static const kSettingsAccount = "/settings/account";

Expand Down
6 changes: 6 additions & 0 deletions simple_live_app/lib/services/local_storage_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ class LocalStorageService extends GetxService {
/// 哔哩哔哩cookie
static const String kBilibiliCookie = "BilibiliCookie";

///主题色
static const String kStyleColor = "kStyleColor";

///动态取色
static const String kIsDynamic = "kIsDynamic";

late Box settingsBox;
late Box<String> shieldBox;

Expand Down
3 changes: 2 additions & 1 deletion simple_live_app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: simple_live_app
version: 1.4.4+10404
version: 1.4.5+10405
publish_to: none
description: "Simple Live APP"
environment:
Expand All @@ -20,6 +20,7 @@ dependencies:
logger: ^2.0.2 #日志
intl: ^0.18.1 #国际化
qr_flutter: ^4.1.0 #二维码生成
dynamic_color: ^1.6.8 #动态颜色

#Widget
flutter_staggered_grid_view: ^0.6.2 #瀑布流/GridView
Expand Down
Loading

0 comments on commit cd4b94c

Please sign in to comment.