diff --git a/lib/common/skeleton/dynamic_card.dart b/lib/common/skeleton/dynamic_card.dart index d816923f9..e5e4062dd 100644 --- a/lib/common/skeleton/dynamic_card.dart +++ b/lib/common/skeleton/dynamic_card.dart @@ -13,7 +13,7 @@ class DynamicCardSkeleton extends StatelessWidget { border: Border( bottom: BorderSide( width: 8, - color: Theme.of(context).dividerColor.withOpacity(0.05), + color: Theme.of(context).dividerColor.withValues(alpha: 0.05), ), ), ), @@ -102,7 +102,7 @@ class DynamicCardSkeleton extends StatelessWidget { foregroundColor: Theme.of(context) .colorScheme .outline - .withOpacity(0.2), + .withValues(alpha: 0.2), ), label: Text( i == 0 diff --git a/lib/common/widgets/animated_dialog.dart b/lib/common/widgets/animated_dialog.dart index a2668e306..d08301d9a 100644 --- a/lib/common/widgets/animated_dialog.dart +++ b/lib/common/widgets/animated_dialog.dart @@ -50,7 +50,7 @@ class AnimatedDialogState extends State @override Widget build(BuildContext context) { return Material( - color: Colors.black.withOpacity(opacityAnimation.value), + color: Colors.black.withValues(alpha: opacityAnimation.value), child: InkWell( highlightColor: Colors.transparent, splashColor: Colors.transparent, diff --git a/lib/common/widgets/audio_video_progress_bar.dart b/lib/common/widgets/audio_video_progress_bar.dart index 6e1307e55..c785e14d1 100644 --- a/lib/common/widgets/audio_video_progress_bar.dart +++ b/lib/common/widgets/audio_video_progress_bar.dart @@ -267,9 +267,10 @@ class ProgressBar extends LeafRenderObjectWidget { onDragUpdate: onDragUpdate, onDragEnd: onDragEnd, barHeight: barHeight, - baseBarColor: baseBarColor ?? primaryColor.withOpacity(0.24), + baseBarColor: baseBarColor ?? primaryColor.withValues(alpha: 0.24), progressBarColor: progressBarColor ?? primaryColor, - bufferedBarColor: bufferedBarColor ?? primaryColor.withOpacity(0.24), + bufferedBarColor: + bufferedBarColor ?? primaryColor.withValues(alpha: 0.24), barCapShape: barCapShape, thumbRadius: thumbRadius, thumbColor: thumbColor ?? primaryColor, @@ -300,9 +301,10 @@ class ProgressBar extends LeafRenderObjectWidget { ..onDragUpdate = onDragUpdate ..onDragEnd = onDragEnd ..barHeight = barHeight - ..baseBarColor = baseBarColor ?? primaryColor.withOpacity(0.24) + ..baseBarColor = baseBarColor ?? primaryColor.withValues(alpha: 0.24) ..progressBarColor = progressBarColor ?? primaryColor - ..bufferedBarColor = bufferedBarColor ?? primaryColor.withOpacity(0.24) + ..bufferedBarColor = + bufferedBarColor ?? primaryColor.withValues(alpha: 0.24) ..barCapShape = barCapShape ..thumbRadius = thumbRadius ..thumbColor = thumbColor ?? primaryColor diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index 1814b080a..60ea427ef 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -38,11 +38,11 @@ class PBadge extends StatelessWidget { // 边框色 Color borderColor = Colors.transparent; if (type == 'gray') { - bgColor = Colors.black54.withOpacity(0.4); + bgColor = Colors.black54.withValues(alpha: 0.4); color = Colors.white; } if (type == 'color') { - bgColor = t.secondaryContainer.withOpacity(0.5); + bgColor = t.secondaryContainer.withValues(alpha: 0.5); color = t.onSecondaryContainer; } if (type == 'line') { diff --git a/lib/common/widgets/custom_toast.dart b/lib/common/widgets/custom_toast.dart index 40998c456..0c72fae35 100644 --- a/lib/common/widgets/custom_toast.dart +++ b/lib/common/widgets/custom_toast.dart @@ -21,7 +21,7 @@ class CustomToast extends StatelessWidget { color: Theme.of(context) .colorScheme .primaryContainer - .withOpacity(toastOpacity), + .withValues(alpha: toastOpacity), borderRadius: BorderRadius.circular(20), ), child: Text( diff --git a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart index 991de6335..19b856f16 100644 --- a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart +++ b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart @@ -282,7 +282,7 @@ class _InteractiveviewerGalleryState extends State end: Alignment.bottomCenter, colors: [ Colors.transparent, - Colors.black.withOpacity(0.3) + Colors.black.withValues(alpha: 0.3) ], ), ) diff --git a/lib/common/widgets/list_sheet.dart b/lib/common/widgets/list_sheet.dart index 1ee1839f1..a16ed27a3 100644 --- a/lib/common/widgets/list_sheet.dart +++ b/lib/common/widgets/list_sheet.dart @@ -334,7 +334,7 @@ class _ListSheetContentState extends State ), Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), if (_isList) Material( @@ -346,7 +346,8 @@ class _ListSheetContentState extends State .map((item) => Tab(text: item.title)) .toList(), dividerHeight: 1, - dividerColor: Theme.of(context).dividerColor.withOpacity(0.1), + dividerColor: + Theme.of(context).dividerColor.withValues(alpha: 0.1), ), ), Expanded( @@ -407,7 +408,7 @@ class _ListSheetContentState extends State itemScrollController: itemScrollController[i ?? 0], separatorBuilder: (context, index) => Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), ), ); diff --git a/lib/common/widgets/live_card.dart b/lib/common/widgets/live_card.dart index 9d4d4e68c..dd029269a 100644 --- a/lib/common/widgets/live_card.dart +++ b/lib/common/widgets/live_card.dart @@ -21,7 +21,7 @@ class LiveCard extends StatelessWidget { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0), side: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.08), + color: Theme.of(context).dividerColor.withValues(alpha: 0.08), ), ), margin: EdgeInsets.zero, diff --git a/lib/common/widgets/network_img_layer.dart b/lib/common/widgets/network_img_layer.dart index 1fb63a8de..66031f5cf 100644 --- a/lib/common/widgets/network_img_layer.dart +++ b/lib/common/widgets/network_img_layer.dart @@ -114,7 +114,10 @@ class NetworkImgLayer extends StatelessWidget { height: height, clipBehavior: Clip.antiAlias, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4), + color: Theme.of(context) + .colorScheme + .onInverseSurface + .withValues(alpha: 0.4), borderRadius: BorderRadius.circular(type == 'avatar' ? 50 : type == 'emote' diff --git a/lib/common/widgets/overlay_pop.dart b/lib/common/widgets/overlay_pop.dart index e972cdc95..ae5617825 100644 --- a/lib/common/widgets/overlay_pop.dart +++ b/lib/common/widgets/overlay_pop.dart @@ -45,7 +45,7 @@ class OverlayPop extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withValues(alpha: 0.3), borderRadius: const BorderRadius.all(Radius.circular(20))), child: IconButton( diff --git a/lib/common/widgets/segment_progress_bar.dart b/lib/common/widgets/segment_progress_bar.dart index 8ec7e40f7..710b49eef 100644 --- a/lib/common/widgets/segment_progress_bar.dart +++ b/lib/common/widgets/segment_progress_bar.dart @@ -77,7 +77,7 @@ class SegmentProgressBar extends CustomPainter { size.width, 0, ), - Paint()..color = Colors.grey[600]!.withOpacity(0.45), + Paint()..color = Colors.grey[600]!.withValues(alpha: 0.45), ); } diff --git a/lib/common/widgets/stat/danmu.dart b/lib/common/widgets/stat/danmu.dart index 956913d9e..5677400d1 100644 --- a/lib/common/widgets/stat/danmu.dart +++ b/lib/common/widgets/stat/danmu.dart @@ -9,8 +9,8 @@ Widget statDanMu({ }) { Map colorObject = { 'white': Colors.white, - 'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8), - 'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7), + 'gray': Theme.of(context).colorScheme.outline.withValues(alpha: 0.8), + 'black': Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7), }; Color color = colorObject[theme]!; return Row( diff --git a/lib/common/widgets/stat/view.dart b/lib/common/widgets/stat/view.dart index bbe0f41e4..5273dff2c 100644 --- a/lib/common/widgets/stat/view.dart +++ b/lib/common/widgets/stat/view.dart @@ -10,8 +10,8 @@ Widget statView({ }) { Map colorObject = { 'white': Colors.white, - 'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8), - 'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7), + 'gray': Theme.of(context).colorScheme.outline.withValues(alpha: 0.8), + 'black': Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7), }; Color color = colorObject[theme]!; return Row( diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart index 9e0182f02..e0ebe245e 100644 --- a/lib/common/widgets/video_card_v.dart +++ b/lib/common/widgets/video_card_v.dart @@ -327,7 +327,7 @@ class VideoCardV extends StatelessWidget { color: Theme.of(context) .colorScheme .outline - .withOpacity(0.8), + .withValues(alpha: 0.8), ), text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)), @@ -349,7 +349,7 @@ class VideoCardV extends StatelessWidget { color: Theme.of(context) .colorScheme .outline - .withOpacity(0.8), + .withValues(alpha: 0.8), ), text: Utils.shortenChineseDateString( videoItem.desc.split(' · ').last)), diff --git a/lib/common/widgets/video_card_v_member_home.dart b/lib/common/widgets/video_card_v_member_home.dart index 759ba1096..c64d60274 100644 --- a/lib/common/widgets/video_card_v_member_home.dart +++ b/lib/common/widgets/video_card_v_member_home.dart @@ -308,7 +308,7 @@ Widget videoContent(BuildContext context, Item videoItem) { // style: TextStyle( // fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, // color: -// Theme.of(context).colorScheme.outline.withOpacity(0.8), +// Theme.of(context).colorScheme.outline.withValues(alpha: 0.8), // ), // text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)), // )), @@ -326,7 +326,7 @@ Widget videoContent(BuildContext context, Item videoItem) { // style: TextStyle( // fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, // color: -// Theme.of(context).colorScheme.outline.withOpacity(0.8), +// Theme.of(context).colorScheme.outline.withValues(alpha: 0.8), // ), // text: Utils.shortenChineseDateString( // videoItem.desc.split(' · ').last)), diff --git a/lib/pages/bangumi/introduction/widgets/intro_detail.dart b/lib/pages/bangumi/introduction/widgets/intro_detail.dart index d8d15b2d6..9e5d3c1fc 100644 --- a/lib/pages/bangumi/introduction/widgets/intro_detail.dart +++ b/lib/pages/bangumi/introduction/widgets/intro_detail.dart @@ -39,7 +39,7 @@ class IntroDetail extends StatelessWidget { color: Theme.of(context) .colorScheme .onSecondaryContainer - .withOpacity(0.5), + .withValues(alpha: 0.5), borderRadius: const BorderRadius.all(Radius.circular(3))), ), ), diff --git a/lib/pages/dynamics/widgets/additional_panel.dart b/lib/pages/dynamics/widgets/additional_panel.dart index e71f56b9f..568246588 100644 --- a/lib/pages/dynamics/widgets/additional_panel.dart +++ b/lib/pages/dynamics/widgets/additional_panel.dart @@ -18,7 +18,7 @@ Widget addWidget(item, context, type, {floor = 1}) { 'ADDITIONAL_TYPE_COMMON': item.modules.moduleDynamic.additional.common, }; Color bgColor = floor == 1 - ? Theme.of(context).dividerColor.withOpacity(0.08) + ? Theme.of(context).dividerColor.withValues(alpha: 0.08) : Theme.of(context).colorScheme.surface; switch (type) { case 'ADDITIONAL_TYPE_UGC': diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index 923b69eb9..d9545f796 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -30,14 +30,14 @@ class DynamicPanel extends StatelessWidget { // border: Border( // bottom: BorderSide( // width: 8, - // color: Theme.of(context).dividerColor.withOpacity(0.05), + // color: Theme.of(context).dividerColor.withValues(alpha: 0.05), // ), // ), // ), child: Material( elevation: 0, clipBehavior: Clip.hardEdge, - color: Theme.of(context).cardColor.withOpacity(0.5), + color: Theme.of(context).cardColor.withValues(alpha: 0.5), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5), ), diff --git a/lib/pages/dynamics/widgets/dynamic_panel_grpc.dart b/lib/pages/dynamics/widgets/dynamic_panel_grpc.dart index 9e193a3c3..6befc361a 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel_grpc.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel_grpc.dart @@ -29,14 +29,14 @@ class DynamicPanelGrpc extends StatelessWidget { // border: Border( // bottom: BorderSide( // width: 8, - // color: Theme.of(context).dividerColor.withOpacity(0.05), + // color: Theme.of(context).dividerColor.withValues(alpha: 0.05), // ), // ), // ), child: Material( elevation: 0, clipBehavior: Clip.hardEdge, - color: Theme.of(context).cardColor.withOpacity(0.5), + color: Theme.of(context).cardColor.withValues(alpha: 0.5), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5), ), diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart index a08e7ca7b..94eb3cac0 100644 --- a/lib/pages/dynamics/widgets/forward_panel.dart +++ b/lib/pages/dynamics/widgets/forward_panel.dart @@ -131,7 +131,7 @@ Widget forWard(item, context, ctr, source, {floor = 1}) { // return Container( // padding: // const EdgeInsets.only(left: 10, top: 12, right: 10, bottom: 10), - // color: Theme.of(context).dividerColor.withOpacity(0.08), + // color: Theme.of(context).dividerColor.withValues(alpha: 0.08), // child: articlePanel(item, context, floor: floor)); // 转发 case 'DYNAMIC_TYPE_FORWARD': @@ -140,7 +140,7 @@ Widget forWard(item, context, ctr, source, {floor = 1}) { child: Container( padding: const EdgeInsets.only(left: 15, top: 10, right: 15, bottom: 8), - color: Theme.of(context).dividerColor.withOpacity(0.08), + color: Theme.of(context).dividerColor.withValues(alpha: 0.08), child: forWard(item.orig, context, ctr, source, floor: floor + 1), ), ); diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index 528afa9bf..ebcece2aa 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -188,7 +188,7 @@ class _UpPanelState extends State { ? Theme.of(context) .colorScheme .secondaryContainer - .withOpacity(0.7) + .withValues(alpha: 0.7) : Theme.of(context).colorScheme.primary, child: data.face != '' ? NetworkImgLayer( diff --git a/lib/pages/emote/view.dart b/lib/pages/emote/view.dart index f701d53d8..f8cb3d6ae 100644 --- a/lib/pages/emote/view.dart +++ b/lib/pages/emote/view.dart @@ -91,7 +91,7 @@ class _EmotePanelState extends State ), Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), TabBar( controller: _emotePanelController.tabController, diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 69ff9feba..ed8c807b0 100644 --- a/lib/pages/fav_detail/view.dart +++ b/lib/pages/fav_detail/view.dart @@ -365,7 +365,7 @@ class _FavDetailPageState extends State { StyleString.aspectRatio, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -388,7 +388,7 @@ class _FavDetailPageState extends State { return Theme.of(context) .colorScheme .surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index f38ea7559..a766374e1 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -233,7 +233,7 @@ class HistoryItem extends StatelessWidget { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -253,7 +253,7 @@ class HistoryItem extends StatelessWidget { return Theme.of(context) .colorScheme .surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index 2ec69e912..9259931a9 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -179,7 +179,7 @@ class SearchBarAndUser extends StatelessWidget { splashColor: Theme.of(context) .colorScheme .primaryContainer - .withOpacity(0.3), + .withValues(alpha: 0.3), borderRadius: const BorderRadius.all( Radius.circular(50), ), @@ -228,7 +228,7 @@ class UserAndSearchVertical extends StatelessWidget { splashColor: Theme.of(context) .colorScheme .primaryContainer - .withOpacity(0.3), + .withValues(alpha: 0.3), borderRadius: const BorderRadius.all( Radius.circular(50), ), @@ -361,14 +361,14 @@ class CustomChip extends StatelessWidget { return InputChip( side: selected ? BorderSide( - color: colorScheme.secondary.withOpacity(0.2), + color: colorScheme.secondary.withValues(alpha: 0.2), width: 2, ) : BorderSide.none, - // backgroundColor: colorTheme.primaryContainer.withOpacity(0.1), - // selectedColor: colorTheme.secondaryContainer.withOpacity(0.8), + // backgroundColor: colorTheme.primaryContainer.withValues(alpha: 0.1), + // selectedColor: colorTheme.secondaryContainer.withValues(alpha: 0.8), color: WidgetStateProperty.resolveWith((Set states) { - return colorTheme.secondaryContainer.withOpacity(0.6); + return colorTheme.secondaryContainer.withValues(alpha: 0.6); }), padding: const EdgeInsets.fromLTRB(6, 1, 6, 1), label: Text(label, style: chipTextStyle), @@ -400,9 +400,9 @@ class SearchBar extends StatelessWidget { borderRadius: BorderRadius.circular(25), ), child: Material( - color: colorScheme.onSecondaryContainer.withOpacity(0.05), + color: colorScheme.onSecondaryContainer.withValues(alpha: 0.05), child: InkWell( - splashColor: colorScheme.primaryContainer.withOpacity(0.3), + splashColor: colorScheme.primaryContainer.withValues(alpha: 0.3), onTap: () => Get.toNamed( '/search', parameters: {'hintText': ctr!.defaultSearch.value}, diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart index 1db362b98..73229cc68 100644 --- a/lib/pages/html/view.dart +++ b/lib/pages/html/view.dart @@ -296,7 +296,7 @@ class _HtmlRenderPageState extends State thickness: 8, color: Theme.of(context) .dividerColor - .withOpacity(0.05), + .withValues(alpha: 0.05), ), ), ), @@ -318,8 +318,9 @@ class _HtmlRenderPageState extends State if (orientation == Orientation.landscape) ...[ VerticalDivider( thickness: 8, - color: - Theme.of(context).dividerColor.withOpacity(0.05)), + color: Theme.of(context) + .dividerColor + .withValues(alpha: 0.05)), Expanded( flex: _ratio[1].toInt(), child: CustomScrollView( diff --git a/lib/pages/later/view.dart b/lib/pages/later/view.dart index ca23f038b..c903c19ef 100644 --- a/lib/pages/later/view.dart +++ b/lib/pages/later/view.dart @@ -178,7 +178,7 @@ class _LaterPageState extends State { StyleString.aspectRatio, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -198,7 +198,7 @@ class _LaterPageState extends State { return Theme.of(context) .colorScheme .surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index e40f78d03..9fc2fb88b 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -405,7 +405,7 @@ class _LiveRoomPageState extends State border: InputBorder.none, hintText: '发送弹幕', hintStyle: TextStyle( - color: Colors.white.withOpacity(0.6), + color: Colors.white.withValues(alpha: 0.6), ), ), ), diff --git a/lib/pages/login/view.dart b/lib/pages/login/view.dart index 0c82457aa..bb7c65169 100644 --- a/lib/pages/login/view.dart +++ b/lib/pages/login/view.dart @@ -126,7 +126,7 @@ class _LoginPageState extends State { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.4), + .withValues(alpha: 0.4), ), ), ), @@ -138,7 +138,7 @@ class _LoginPageState extends State { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.4)))), + .withValues(alpha: 0.4)))), ], ); } @@ -278,7 +278,7 @@ class _LoginPageState extends State { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.4)))), + .withValues(alpha: 0.4)))), ], ); } @@ -294,8 +294,10 @@ class _LoginPageState extends State { child: Container( decoration: UnderlineTabIndicator( borderSide: BorderSide( - color: - Theme.of(context).colorScheme.outline.withOpacity(0.4)), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.4)), ), child: Row( children: [ @@ -337,7 +339,7 @@ class _LoginPageState extends State { color: Theme.of(context) .colorScheme .outline - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), const SizedBox(width: 6), @@ -365,8 +367,10 @@ class _LoginPageState extends State { child: Container( decoration: UnderlineTabIndicator( borderSide: BorderSide( - color: - Theme.of(context).colorScheme.outline.withOpacity(0.4)), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.4)), ), child: Row( children: [ @@ -414,7 +418,7 @@ class _LoginPageState extends State { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.4)))), + .withValues(alpha: 0.4)))), ], ); } diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 006ad3872..a50474f38 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -227,8 +227,10 @@ class _MainAppState extends State width: 1, indent: MediaQuery.of(context).padding.top, endIndent: MediaQuery.of(context).padding.bottom, - color: - Theme.of(context).colorScheme.outline.withOpacity(0.06), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.06), ), Expanded( child: PageView( diff --git a/lib/pages/media/view.dart b/lib/pages/media/view.dart index 8389ca70f..daba4fcda 100644 --- a/lib/pages/media/view.dart +++ b/lib/pages/media/view.dart @@ -131,7 +131,7 @@ class _MediaPageState extends State children: [ Divider( height: 20, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), ListTile( onTap: () async { @@ -214,7 +214,7 @@ class _MediaPageState extends State return Theme.of(context) .colorScheme .primaryContainer - .withOpacity(0.5); + .withValues(alpha: 0.5); }), ), onPressed: () async { @@ -302,13 +302,13 @@ class FavFolderItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onInverseSurface - .withOpacity(0.4), + .withValues(alpha: 0.4), boxShadow: [ BoxShadow( color: Theme.of(context) .colorScheme .onInverseSurface - .withOpacity(0.4), + .withValues(alpha: 0.4), offset: const Offset(4, -12), // 阴影与容器的距离 blurRadius: 0.0, // 高斯的标准偏差与盒子的形状卷积。 spreadRadius: 0.0, // 在应用模糊之前,框应该膨胀的量。 diff --git a/lib/pages/member/new/widget/edit_profile_page.dart b/lib/pages/member/new/widget/edit_profile_page.dart index eef997a81..43ff8ac6e 100644 --- a/lib/pages/member/new/widget/edit_profile_page.dart +++ b/lib/pages/member/new/widget/edit_profile_page.dart @@ -90,12 +90,12 @@ class _EditProfilePageState extends State { Widget get _divider => Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ); Widget get _divider1 => Divider( thickness: 16, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ); Widget _buildBody(LoadingState loadingState) { diff --git a/lib/pages/member/new/widget/user_info_card.dart b/lib/pages/member/new/widget/user_info_card.dart index 5d1c30560..b53e274f7 100644 --- a/lib/pages/member/new/widget/user_info_card.dart +++ b/lib/pages/member/new/widget/user_info_card.dart @@ -208,7 +208,7 @@ class UserInfoCard extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ) ], @@ -328,7 +328,7 @@ class UserInfoCard extends StatelessWidget { color: Theme.of(context) .colorScheme .outline - .withOpacity(0.5), + .withValues(alpha: 0.5), ), padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, diff --git a/lib/pages/msg_feed_top/at_me/view.dart b/lib/pages/msg_feed_top/at_me/view.dart index a8304a4e9..458e277f3 100644 --- a/lib/pages/msg_feed_top/at_me/view.dart +++ b/lib/pages/msg_feed_top/at_me/view.dart @@ -131,7 +131,7 @@ class _AtMePageState extends State { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ); diff --git a/lib/pages/msg_feed_top/like_me/view.dart b/lib/pages/msg_feed_top/like_me/view.dart index 38cf253ae..e378f0212 100644 --- a/lib/pages/msg_feed_top/like_me/view.dart +++ b/lib/pages/msg_feed_top/like_me/view.dart @@ -198,7 +198,7 @@ class LikeMeList extends StatelessWidget { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ); diff --git a/lib/pages/msg_feed_top/reply_me/view.dart b/lib/pages/msg_feed_top/reply_me/view.dart index 97fe30828..8f7ddee10 100644 --- a/lib/pages/msg_feed_top/reply_me/view.dart +++ b/lib/pages/msg_feed_top/reply_me/view.dart @@ -144,7 +144,7 @@ class _ReplyMePageState extends State { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ); diff --git a/lib/pages/msg_feed_top/sys_msg/view.dart b/lib/pages/msg_feed_top/sys_msg/view.dart index 575416999..b26fa69de 100644 --- a/lib/pages/msg_feed_top/sys_msg/view.dart +++ b/lib/pages/msg_feed_top/sys_msg/view.dart @@ -127,7 +127,7 @@ class _SysMsgPageState extends State { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withValues(alpha: 0.85), ), ), const SizedBox(height: 5), @@ -156,7 +156,7 @@ class _SysMsgPageState extends State { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ); diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index 39d83b2e9..f05052adb 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -23,7 +23,7 @@ class _SearchPageState extends State with RouteAware { appBar: AppBar( shape: Border( bottom: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.08), + color: Theme.of(context).dividerColor.withValues(alpha: 0.08), width: 1, ), ), diff --git a/lib/pages/search_panel/widgets/video_panel.dart b/lib/pages/search_panel/widgets/video_panel.dart index 803bb4630..216623dd8 100644 --- a/lib/pages/search_panel/widgets/video_panel.dart +++ b/lib/pages/search_panel/widgets/video_panel.dart @@ -163,7 +163,7 @@ class CustomFilterChip extends StatelessWidget { ), selectedColor: Colors.transparent, // backgroundColor: - // Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5), + // Theme.of(context).colorScheme.surfaceVariant.withValues(alpha: 0.5), backgroundColor: Colors.transparent, side: BorderSide.none, onSelected: (bool selected) => callFn?.call(selected), @@ -312,11 +312,17 @@ class VideoPanelController extends GetxController { bgColor: currentPubTimeFilterval == -1 && (isFirst ? customPubBegin : customPubEnd) ? Theme.of(context).colorScheme.secondaryContainer - : Theme.of(context).colorScheme.outline.withOpacity(0.1), + : Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.1), textColor: currentPubTimeFilterval == -1 && (isFirst ? customPubBegin : customPubEnd) ? Theme.of(context).colorScheme.onSecondaryContainer - : Theme.of(context).colorScheme.outline.withOpacity(0.8), + : Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.8), ); } diff --git a/lib/pages/search_result/view.dart b/lib/pages/search_result/view.dart index 5818e68bf..5b976bd0e 100644 --- a/lib/pages/search_result/view.dart +++ b/lib/pages/search_result/view.dart @@ -51,7 +51,7 @@ class _SearchResultPageState extends State appBar: AppBar( shape: Border( bottom: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.08), + color: Theme.of(context).dividerColor.withValues(alpha: 0.08), width: 1, ), ), diff --git a/lib/pages/setting/pages/color_select.dart b/lib/pages/setting/pages/color_select.dart index b8380787e..025cd6d05 100644 --- a/lib/pages/setting/pages/color_select.dart +++ b/lib/pages/setting/pages/color_select.dart @@ -171,13 +171,13 @@ class _ColorSelectPageState extends State { width: 46, height: 46, decoration: BoxDecoration( - color: e['color'].withOpacity(0.8), + color: e['color'].withValues(alpha: 0.8), borderRadius: BorderRadius.circular(50), border: Border.all( width: 2, color: ctr.currentColor.value == index ? Colors.black - : e['color'].withOpacity(0.8), + : e['color'].withValues(alpha: 0.8), ), ), child: AnimatedOpacity( diff --git a/lib/pages/setting/pages/font_size_select.dart b/lib/pages/setting/pages/font_size_select.dart index 69bd5599c..450f277b8 100644 --- a/lib/pages/setting/pages/font_size_select.dart +++ b/lib/pages/setting/pages/font_size_select.dart @@ -72,7 +72,7 @@ class _FontSizeSelectPageState extends State { color: Theme.of(context) .colorScheme .primary - .withOpacity(0.3))), + .withValues(alpha: 0.3))), color: Theme.of(context).colorScheme.surface, ), child: Row( diff --git a/lib/pages/setting/recommend_setting.dart b/lib/pages/setting/recommend_setting.dart index dcd936322..7b012ebd8 100644 --- a/lib/pages/setting/recommend_setting.dart +++ b/lib/pages/setting/recommend_setting.dart @@ -1,3 +1,4 @@ +import 'package:PiliPalaX/utils/extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -208,6 +209,7 @@ class _RecommendSettingState extends State { style: subTitleStyle, ), onTap: () async { + const List defDurations = [0, 30, 60, 90, 120]; int? result = await showDialog( context: context, builder: (context) { @@ -216,18 +218,8 @@ class _RecommendSettingState extends State { value: minDurationForRcmd, values: [ ...[ - 0, - 30, - 60, - 90, - 120, - if (![ - 0, - 30, - 60, - 90, - 120, - ].contains(minDurationForRcmd)) + ...defDurations, + if (defDurations.contains(minDurationForRcmd).not) minDurationForRcmd, ]..sort(), -1 @@ -240,21 +232,26 @@ class _RecommendSettingState extends State { }, ); if (result != null) { + void updateDuration(int value) { + minDurationForRcmd = value; + setting.put(SettingBoxKey.minDurationForRcmd, value); + RecommendFilter.update(); + setState(() {}); + } + if (result == -1 && context.mounted) { showDialog( context: context, builder: (context) { - String initialValue = - result == -1 ? '' : minDurationForRcmd.toString(); + String duration = ''; return AlertDialog( title: Text( '自定义时长', style: TextStyle(fontSize: 18), ), - content: TextFormField( + content: TextField( autofocus: true, - initialValue: initialValue, - onChanged: (value) => initialValue = value, + onChanged: (value) => duration = value, keyboardType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow(RegExp(r'\d+')), @@ -273,26 +270,16 @@ class _RecommendSettingState extends State { TextButton( onPressed: () { Get.back(); - int result = int.tryParse(initialValue) ?? 0; - minDurationForRcmd = result; - setting.put( - SettingBoxKey.minDurationForRcmd, result); - RecommendFilter.update(); - setState(() {}); + updateDuration(int.tryParse(duration) ?? 0); }, - child: Text( - '确定', - ), + child: const Text('确定'), ), ], ); }, ); } else { - minDurationForRcmd = result; - setting.put(SettingBoxKey.minDurationForRcmd, result); - RecommendFilter.update(); - setState(() {}); + updateDuration(result); } } }, @@ -351,8 +338,10 @@ class _RecommendSettingState extends State { '* 设定较严苛的条件可导致推荐项数锐减或多次请求,请酌情选择。\n' '* 后续可能会增加更多过滤条件,敬请期待。', style: Theme.of(context).textTheme.labelSmall!.copyWith( - color: - Theme.of(context).colorScheme.outline.withOpacity(0.7)), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.7)), ), ) ], diff --git a/lib/pages/setting/sponsor_block_page.dart b/lib/pages/setting/sponsor_block_page.dart index 13aa0b065..4513a1c33 100644 --- a/lib/pages/setting/sponsor_block_page.dart +++ b/lib/pages/setting/sponsor_block_page.dart @@ -362,14 +362,14 @@ class _SponsorBlockPageState extends State { Widget get _divider => SliverToBoxAdapter( child: Divider( height: 1, - color: Theme.of(context).colorScheme.outline.withOpacity(0.1), + color: Theme.of(context).colorScheme.outline.withValues(alpha: 0.1), ), ); Widget get _dividerL => SliverToBoxAdapter( child: Divider( thickness: 16, - color: Theme.of(context).colorScheme.outline.withOpacity(0.1), + color: Theme.of(context).colorScheme.outline.withValues(alpha: 0.1), ), ); @@ -529,7 +529,8 @@ class _SponsorBlockPageState extends State { ), separatorBuilder: (context, index) => Divider( height: 1, - color: Theme.of(context).colorScheme.outline.withOpacity(0.1), + color: + Theme.of(context).colorScheme.outline.withValues(alpha: 0.1), ), ), _dividerL, diff --git a/lib/pages/subscription_detail/view.dart b/lib/pages/subscription_detail/view.dart index 52285d068..191092f1d 100644 --- a/lib/pages/subscription_detail/view.dart +++ b/lib/pages/subscription_detail/view.dart @@ -102,7 +102,8 @@ class _SubDetailPageState extends State { decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.2), + color: + Theme.of(context).dividerColor.withValues(alpha: 0.2), ), ), ), diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 92143292e..0c955088c 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -522,7 +522,7 @@ class VideoDetailController extends GetxController color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), ) diff --git a/lib/pages/video/detail/introduction/widgets/action_row_item.dart b/lib/pages/video/detail/introduction/widgets/action_row_item.dart index 3cfbc3e9f..ce4009672 100644 --- a/lib/pages/video/detail/introduction/widgets/action_row_item.dart +++ b/lib/pages/video/detail/introduction/widgets/action_row_item.dart @@ -25,8 +25,11 @@ class ActionRowItem extends StatelessWidget { Widget build(BuildContext context) { return Material( color: selectStatus - ? Theme.of(context).colorScheme.primaryContainer.withOpacity(0.6) - : Theme.of(context).highlightColor.withOpacity(0.2), + ? Theme.of(context) + .colorScheme + .primaryContainer + .withValues(alpha: 0.6) + : Theme.of(context).highlightColor.withValues(alpha: 0.2), borderRadius: const BorderRadius.all(Radius.circular(30)), clipBehavior: Clip.hardEdge, child: InkWell( diff --git a/lib/pages/video/detail/introduction/widgets/fav_panel.dart b/lib/pages/video/detail/introduction/widgets/fav_panel.dart index 3450a9b1f..2098b1c7c 100644 --- a/lib/pages/video/detail/introduction/widgets/fav_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/fav_panel.dart @@ -167,7 +167,7 @@ class _FavPanelState extends State { ), Divider( height: 1, - color: Theme.of(context).disabledColor.withOpacity(0.08), + color: Theme.of(context).disabledColor.withValues(alpha: 0.08), ), Padding( padding: EdgeInsets.only( diff --git a/lib/pages/video/detail/introduction/widgets/group_panel.dart b/lib/pages/video/detail/introduction/widgets/group_panel.dart index 45046c2fb..3038fe5e5 100644 --- a/lib/pages/video/detail/introduction/widgets/group_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/group_panel.dart @@ -170,7 +170,7 @@ class _GroupPanelState extends State { ), Divider( height: 1, - color: Theme.of(context).disabledColor.withOpacity(0.08), + color: Theme.of(context).disabledColor.withValues(alpha: 0.08), ), Padding( padding: EdgeInsets.only( diff --git a/lib/pages/video/detail/introduction/widgets/menu_row.dart b/lib/pages/video/detail/introduction/widgets/menu_row.dart index ad52daf92..f2283eab4 100644 --- a/lib/pages/video/detail/introduction/widgets/menu_row.dart +++ b/lib/pages/video/detail/introduction/widgets/menu_row.dart @@ -54,7 +54,7 @@ class MenuRow extends StatelessWidget { {bool selectStatus = false}) { return Material( color: selectStatus - ? Theme.of(context).highlightColor.withOpacity(0.2) + ? Theme.of(context).highlightColor.withValues(alpha: 0.2) : Colors.transparent, borderRadius: const BorderRadius.all(Radius.circular(30)), clipBehavior: Clip.hardEdge, @@ -70,7 +70,7 @@ class MenuRow extends StatelessWidget { border: Border.all( color: selectStatus ? Colors.transparent - : Theme.of(context).highlightColor.withOpacity(0.2), + : Theme.of(context).highlightColor.withValues(alpha: 0.2), ), ), child: Row( diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 32fbcf940..4319af8bb 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -90,7 +90,7 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onInverseSurface - .withOpacity(0.5), + .withValues(alpha: 0.5), ) ], ), @@ -352,7 +352,10 @@ class ReplyItem extends StatelessWidget { Icon( Icons.reply, size: 18, - color: Theme.of(context).colorScheme.outline.withOpacity(0.8), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.8), ), const SizedBox(width: 3), Text( @@ -460,7 +463,7 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withValues(alpha: 0.85), height: 1.6), overflow: TextOverflow.ellipsis, maxLines: 2, @@ -539,7 +542,7 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withValues(alpha: 0.85), )), TextSpan( text: replyControl!.entryText!, diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 19d0a5385..c3e9649ac 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -101,7 +101,7 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .onInverseSurface - .withOpacity(0.5), + .withValues(alpha: 0.5), ) ], ), @@ -349,7 +349,10 @@ class ReplyItemGrpc extends StatelessWidget { Icon( Icons.reply, size: 18, - color: Theme.of(context).colorScheme.outline.withOpacity(0.8), + color: Theme.of(context) + .colorScheme + .outline + .withValues(alpha: 0.8), ), const SizedBox(width: 3), Text( @@ -476,7 +479,7 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withValues(alpha: 0.85), height: 1.6), overflow: TextOverflow.ellipsis, maxLines: 2, @@ -558,7 +561,7 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withValues(alpha: 0.85), ), ), TextSpan( diff --git a/lib/pages/video/detail/reply_new/reply_page.dart b/lib/pages/video/detail/reply_new/reply_page.dart index 2a7a18908..0e38e87a7 100644 --- a/lib/pages/video/detail/reply_new/reply_page.dart +++ b/lib/pages/video/detail/reply_new/reply_page.dart @@ -306,7 +306,7 @@ class _ReplyPageState extends State ), Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), Container( height: 52, diff --git a/lib/pages/video/detail/reply_new/view.dart b/lib/pages/video/detail/reply_new/view.dart index 4b62f19c2..9dae72f98 100644 --- a/lib/pages/video/detail/reply_new/view.dart +++ b/lib/pages/video/detail/reply_new/view.dart @@ -195,7 +195,7 @@ class _VideoReplyNewDialogState extends State ), Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), Container( height: 52, diff --git a/lib/pages/video/detail/reply_reply/view.dart b/lib/pages/video/detail/reply_reply/view.dart index a23927f3a..b43a28e66 100644 --- a/lib/pages/video/detail/reply_reply/view.dart +++ b/lib/pages/video/detail/reply_reply/view.dart @@ -136,7 +136,7 @@ class _VideoReplyReplyPanelState extends State { ), Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), Expanded( child: refreshIndicator( @@ -192,7 +192,7 @@ class _VideoReplyReplyPanelState extends State { height: 20, color: Theme.of(context) .dividerColor - .withOpacity(0.1), + .withValues(alpha: 0.1), thickness: 6, ); } else if (index == 2) { diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index d97dce82b..296eb06ac 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -726,7 +726,7 @@ class _VideoDetailPageState extends State // child: Divider( // indent: 12, // endIndent: 12, - // color: Theme.of(context).dividerColor.withOpacity(0.06), + // color: Theme.of(context).dividerColor.withValues(alpha: 0.06), // ), // ), // const RelatedVideoPanel(), @@ -1112,7 +1112,7 @@ class _VideoDetailPageState extends State border: Border( bottom: BorderSide( width: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context).dividerColor.withValues(alpha: 0.1), ), ), ), @@ -1271,7 +1271,7 @@ class _VideoDetailPageState extends State height: 1, indent: 12, endIndent: 12, - color: Theme.of(context).dividerColor.withOpacity(0.06), + color: Theme.of(context).dividerColor.withValues(alpha: 0.06), ), ), ), @@ -1445,7 +1445,9 @@ class _VideoDetailPageState extends State if (rawIndex % 2 == 1) { return Divider( height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context) + .dividerColor + .withValues(alpha: 0.1), ); } int index = rawIndex ~/ 2; diff --git a/lib/pages/video/detail/widgets/ai_detail.dart b/lib/pages/video/detail/widgets/ai_detail.dart index bab7c6d3b..246471862 100644 --- a/lib/pages/video/detail/widgets/ai_detail.dart +++ b/lib/pages/video/detail/widgets/ai_detail.dart @@ -55,7 +55,9 @@ class AiDetail extends StatelessWidget { if (modelResult!.outline!.isNotEmpty) Divider( height: 20, - color: Theme.of(context).dividerColor.withOpacity(0.1), + color: Theme.of(context) + .dividerColor + .withValues(alpha: 0.1), thickness: 6, ) ], diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index a42fa22a6..09146feee 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -145,7 +145,7 @@ class _HeaderControlState extends State { color: Theme.of(context) .colorScheme .onSecondaryContainer - .withOpacity(0.5), + .withValues(alpha: 0.5), borderRadius: const BorderRadius.all(Radius.circular(3))), ), diff --git a/lib/pages/whisper/view.dart b/lib/pages/whisper/view.dart index 103c45c5b..4132c2850 100644 --- a/lib/pages/whisper/view.dart +++ b/lib/pages/whisper/view.dart @@ -307,7 +307,7 @@ class _WhisperPageState extends State { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ), diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 76590df69..4f9979729 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -144,7 +144,8 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 5, - color: Theme.of(context).colorScheme.outline.withOpacity(0.8), + color: + Theme.of(context).colorScheme.outline.withValues(alpha: 0.8), ), ); case MsgType.text: @@ -195,7 +196,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor(context).withOpacity(0.6), + color: textColor(context).withValues(alpha: 0.6), fontSize: 12, ), ), @@ -246,7 +247,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor(context).withOpacity(0.6), + color: textColor(context).withValues(alpha: 0.6), fontSize: 12, ), ), @@ -261,7 +262,7 @@ class ChatItem extends StatelessWidget { color: Theme.of(context) .colorScheme .secondaryContainer - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), @@ -343,7 +344,8 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor(context).withOpacity(0.6), + color: textColor(context) + .withValues(alpha: 0.6), fontSize: 12, ), ), @@ -352,7 +354,8 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor(context).withOpacity(0.6), + color: textColor(context) + .withValues(alpha: 0.6), fontSize: 12, ), ), @@ -428,11 +431,11 @@ class ChatItem extends StatelessWidget { ? Theme.of(context) .colorScheme .onPrimary - .withOpacity(0.8) + .withValues(alpha: 0.8) : Theme.of(context) .colorScheme .onSecondaryContainer - .withOpacity(0.8)), + .withValues(alpha: 0.8)), ), item.msgStatus == 1 ? Text( @@ -471,7 +474,7 @@ class SystemNotice extends StatelessWidget { color: Theme.of(context) .colorScheme .secondaryContainer - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), @@ -497,7 +500,10 @@ class SystemNotice extends StatelessWidget { .copyWith(color: Theme.of(context).colorScheme.outline), ), Divider( - color: Theme.of(context).colorScheme.primary.withOpacity(0.05), + color: Theme.of(context) + .colorScheme + .primary + .withValues(alpha: 0.05), ), SelectableText( content['text'], diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index ffb442d1f..d9005fb9b 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -444,7 +444,7 @@ class _PLVideoPlayerState extends State plPlayerController.vttSubtitlesIndex.value ? 0 : plPlayerController.vttSubtitlesIndex.value, - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return plPlayerController.vttSubtitles .asMap() @@ -483,7 +483,7 @@ class _PLVideoPlayerState extends State plPlayerController.setPlaybackSpeed(value); }, initialValue: plPlayerController.playbackSpeed, - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return plPlayerController.speedList.map((double speed) { return PopupMenuItem( @@ -1077,11 +1077,11 @@ class _PLVideoPlayerState extends State buffered: Duration(seconds: buffer), total: Duration(seconds: max), progressBarColor: colorTheme, - baseBarColor: Colors.white.withOpacity(0.2), + baseBarColor: Colors.white.withValues(alpha: 0.2), bufferedBarColor: Theme.of(context) .colorScheme .primary - .withOpacity(0.4), + .withValues(alpha: 0.4), timeLabelLocation: TimeLabelLocation.none, thumbColor: colorTheme, barHeight: 3.5, diff --git a/lib/plugin/pl_player/widgets/bottom_control.dart b/lib/plugin/pl_player/widgets/bottom_control.dart index 6588bf703..b17af21d0 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -57,8 +57,8 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { buffered: Duration(seconds: buffer), total: Duration(seconds: max), progressBarColor: colorTheme, - baseBarColor: Colors.white.withOpacity(0.2), - bufferedBarColor: colorTheme.withOpacity(0.4), + baseBarColor: Colors.white.withValues(alpha: 0.2), + bufferedBarColor: colorTheme.withValues(alpha: 0.4), timeLabelLocation: TimeLabelLocation.none, thumbColor: colorTheme, barHeight: 3.5,