From 448d554f03d54fbf40a0e62cb86ff799a46b3abe Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 26 Aug 2024 20:45:45 +0800 Subject: [PATCH] opt: color --- lib/common/widgets/video_card_v.dart | 1 - lib/main.dart | 28 +++++++++++++++++++ lib/pages/bangumi/widgets/bangumi_card_v.dart | 1 - lib/pages/live/widgets/live_item.dart | 25 ++++++++--------- lib/pages/setting/pages/color_select.dart | 1 + 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart index ea3ed8b6..423a6e48 100644 --- a/lib/common/widgets/video_card_v.dart +++ b/lib/common/widgets/video_card_v.dart @@ -132,7 +132,6 @@ class VideoCardV extends StatelessWidget { label: Utils.videoItemSemantics(videoItem), excludeSemantics: true, child: Card( - elevation: 0, clipBehavior: Clip.hardEdge, margin: EdgeInsets.zero, child: GestureDetector( diff --git a/lib/main.dart b/lib/main.dart index 142af3d7..d8e0eb90 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -180,6 +180,20 @@ class MyApp extends StatelessWidget { ), }, ), + popupMenuTheme: PopupMenuThemeData( + surfaceTintColor: lightColorScheme.surfaceTint, + ), + cardTheme: CardTheme( + elevation: 2, + surfaceTintColor: lightColorScheme.surfaceTint, + shadowColor: Colors.transparent, + ), + dialogTheme: DialogTheme( + surfaceTintColor: lightColorScheme.surfaceTint, + ), + progressIndicatorTheme: ProgressIndicatorThemeData( + refreshBackgroundColor: lightColorScheme.onSecondary, + ), ), darkTheme: ThemeData( // fontFamily: 'HarmonyOS', @@ -198,6 +212,20 @@ class MyApp extends StatelessWidget { contentTextStyle: TextStyle(color: darkColorScheme.secondary), elevation: 20, ), + popupMenuTheme: PopupMenuThemeData( + surfaceTintColor: darkColorScheme.surfaceTint, + ), + cardTheme: CardTheme( + elevation: 2, + surfaceTintColor: darkColorScheme.surfaceTint, + shadowColor: Colors.transparent, + ), + dialogTheme: DialogTheme( + surfaceTintColor: darkColorScheme.surfaceTint, + ), + progressIndicatorTheme: ProgressIndicatorThemeData( + refreshBackgroundColor: darkColorScheme.onSecondary, + ), ), localizationsDelegates: const [ GlobalCupertinoLocalizations.delegate, diff --git a/lib/pages/bangumi/widgets/bangumi_card_v.dart b/lib/pages/bangumi/widgets/bangumi_card_v.dart index 70abd36e..acb98fd6 100644 --- a/lib/pages/bangumi/widgets/bangumi_card_v.dart +++ b/lib/pages/bangumi/widgets/bangumi_card_v.dart @@ -26,7 +26,6 @@ class BangumiCardV extends StatelessWidget { Widget build(BuildContext context) { String heroTag = Utils.makeHeroTag(bangumiItem.mediaId); return Card( - elevation: 0, clipBehavior: Clip.hardEdge, margin: EdgeInsets.zero, child: GestureDetector( diff --git a/lib/pages/live/widgets/live_item.dart b/lib/pages/live/widgets/live_item.dart index 57122377..5200952f 100644 --- a/lib/pages/live/widgets/live_item.dart +++ b/lib/pages/live/widgets/live_item.dart @@ -22,7 +22,6 @@ class LiveCardV extends StatelessWidget { Widget build(BuildContext context) { String heroTag = Utils.makeHeroTag(liveItem.roomId); return Card( - elevation: 0, clipBehavior: Clip.hardEdge, margin: EdgeInsets.zero, child: GestureDetector( @@ -60,18 +59,18 @@ class LiveCardV extends StatelessWidget { height: maxHeight, ), ), - Positioned( - left: 0, - right: 0, - bottom: 0, - child: AnimatedOpacity( - opacity: 1, - duration: const Duration(milliseconds: 200), - child: VideoStat( - liveItem: liveItem, - ), + Positioned( + left: 0, + right: 0, + bottom: 0, + child: AnimatedOpacity( + opacity: 1, + duration: const Duration(milliseconds: 200), + child: VideoStat( + liveItem: liveItem, ), ), + ), ], ); }), @@ -88,9 +87,7 @@ class LiveCardV extends StatelessWidget { class LiveContent extends StatelessWidget { final dynamic liveItem; - const LiveContent( - {Key? key, required this.liveItem}) - : super(key: key); + const LiveContent({Key? key, required this.liveItem}) : super(key: key); @override Widget build(BuildContext context) { return Expanded( diff --git a/lib/pages/setting/pages/color_select.dart b/lib/pages/setting/pages/color_select.dart index 6cc17cf1..94331c84 100644 --- a/lib/pages/setting/pages/color_select.dart +++ b/lib/pages/setting/pages/color_select.dart @@ -52,6 +52,7 @@ class _ColorSelectPageState extends State { onChanged: (dynamic val) async { ctr.type.value = 0; ctr.setting.put(SettingBoxKey.dynamicColor, true); + Get.forceAppUpdate(); }, ), ),