From 7ae92970efc6ccb2b6ef182865891b292712adcb Mon Sep 17 00:00:00 2001 From: dom Date: Fri, 16 May 2025 23:05:02 +0800 Subject: [PATCH] bump flutter (#859) Signed-off-by: bggRGjQaUbCoE --- .github/workflows/android.yml | 13 - android/app/.gitignore | 2 + android/app/build.gradle | 10 +- android/app/proguard-rules.pro | 1 + android/app/src/main/AndroidManifest.xml | 3 + android/build.gradle | 41 ++- .../gradle/wrapper/gradle-wrapper.properties | 6 +- android/settings.gradle | 9 +- lib/common/skeleton/dynamic_card.dart | 4 +- lib/common/widgets/badge.dart | 2 +- lib/common/widgets/custom_toast.dart | 3 +- lib/common/widgets/image/image_save.dart | 2 +- lib/common/widgets/image/image_view.dart | 2 +- .../widgets/image/network_img_layer.dart | 5 +- .../interactiveviewer_gallery.dart | 2 +- .../audio_video_progress_bar.dart | 10 +- .../progress_bar/segment_progress_bar.dart | 2 +- lib/common/widgets/refresh_indicator.dart | 292 ++++++++++------ lib/common/widgets/stat/stat.dart | 6 +- lib/common/widgets/tabs.dart | 17 +- .../widgets/video_card/video_card_v.dart | 4 +- lib/pages/article/view.dart | 6 +- lib/pages/article_list/view.dart | 2 +- lib/pages/common/common_publish_page.dart | 2 +- .../dynamics/widgets/additional_panel.dart | 8 +- lib/pages/dynamics/widgets/dynamic_panel.dart | 2 +- lib/pages/dynamics/widgets/forward_panel.dart | 6 +- lib/pages/dynamics/widgets/up_panel.dart | 2 +- lib/pages/dynamics_detail/view.dart | 2 +- lib/pages/dynamics_repost/view.dart | 2 +- lib/pages/emote/view.dart | 6 +- lib/pages/episode_panel/view.dart | 4 +- lib/pages/fav/note/child_view.dart | 2 +- lib/pages/fav/note/widget/item.dart | 5 +- lib/pages/fav/pgc/child_view.dart | 2 +- lib/pages/fav/pgc/widget/item.dart | 5 +- lib/pages/fav_detail/view.dart | 4 +- lib/pages/fav_panel/view.dart | 2 +- lib/pages/group_panel/view.dart | 2 +- lib/pages/history/widgets/item.dart | 4 +- lib/pages/home/view.dart | 7 +- lib/pages/later/child_view.dart | 4 +- lib/pages/live_emote/view.dart | 2 +- lib/pages/live_room/send_danmaku/view.dart | 2 +- .../live_room/widgets/bottom_control.dart | 4 +- lib/pages/live_room/widgets/chat.dart | 4 +- lib/pages/live_search/child/view.dart | 3 +- lib/pages/login/view.dart | 18 +- lib/pages/main/view.dart | 4 +- lib/pages/media/view.dart | 10 +- lib/pages/member/widget/user_info_card.dart | 4 +- lib/pages/member_profile/view.dart | 4 +- lib/pages/msg_feed_top/at_me/view.dart | 4 +- lib/pages/msg_feed_top/like_me/view.dart | 6 +- lib/pages/msg_feed_top/reply_me/view.dart | 4 +- lib/pages/msg_feed_top/sys_msg/view.dart | 5 +- lib/pages/search/view.dart | 4 +- lib/pages/search_panel/video/controller.dart | 4 +- lib/pages/search_result/view.dart | 2 +- lib/pages/search_trending/view.dart | 9 +- lib/pages/setting/pages/color_select.dart | 10 +- lib/pages/setting/pages/font_size_select.dart | 3 +- lib/pages/setting/recommend_setting.dart | 4 +- lib/pages/setting/view.dart | 2 +- lib/pages/share/view.dart | 2 +- lib/pages/sponsor_block/view.dart | 12 +- lib/pages/subscription_detail/view.dart | 2 +- lib/pages/video/ai/view.dart | 2 +- lib/pages/video/controller.dart | 6 +- .../pgc/widgets/intro_detail.dart | 4 +- .../ugc/widgets/action_row_item.dart | 4 +- .../introduction/ugc/widgets/menu_row.dart | 4 +- lib/pages/video/medialist/view.dart | 2 +- lib/pages/video/note/view.dart | 6 +- lib/pages/video/pay_coins/view.dart | 6 +- .../video/reply/widgets/reply_item_grpc.dart | 12 +- lib/pages/video/reply_new/view.dart | 2 +- lib/pages/video/reply_reply/view.dart | 6 +- lib/pages/video/send_danmaku/view.dart | 2 +- lib/pages/video/view.dart | 16 +- lib/pages/video/view_point/view.dart | 4 +- lib/pages/whisper/view.dart | 2 +- lib/pages/whisper/widgets/item.dart | 2 +- lib/pages/whisper_detail/view.dart | 2 +- .../whisper_detail/widget/chat_item.dart | 26 +- lib/pages/whisper_link_setting/view.dart | 4 +- lib/pages/whisper_secondary/view.dart | 2 +- lib/pages/whisper_settings/view.dart | 2 +- lib/pages/whisper_settings/widgets/item.dart | 2 +- lib/plugin/pl_player/controller.dart | 2 +- lib/plugin/pl_player/view.dart | 16 +- .../pl_player/widgets/bottom_control.dart | 7 +- lib/utils/login_utils.dart | 2 - lib/utils/theme_utils.dart | 1 + pubspec.lock | 330 +++++++++--------- pubspec.yaml | 6 +- 96 files changed, 604 insertions(+), 521 deletions(-) create mode 100644 android/app/.gitignore create mode 100644 android/app/proguard-rules.pro diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 2cf000516..0d99a7cf3 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -33,19 +33,6 @@ jobs: channel: stable flutter-version-file: pubspec.yaml - - name: 修复3.24的stable显示中文不正确问题 // from orz12 - run: | - version=$(grep -m 1 'flutter:' pubspec.yaml | awk '{print $2}') - if [ "$(echo "$version < 3.27.0" | awk '{print ($1 < $2)}')" -eq 1 ]; then - cd $FLUTTER_ROOT - git config --global user.name "orz12" - git config --global user.email "orz12@test.com" - git cherry-pick d4124bd --strategy-option theirs - # flutter precache - flutter --version - cd - - fi - - name: 下载项目依赖 run: flutter pub get diff --git a/android/app/.gitignore b/android/app/.gitignore new file mode 100644 index 000000000..8268dac65 --- /dev/null +++ b/android/app/.gitignore @@ -0,0 +1,2 @@ +/.cxx +/build diff --git a/android/app/build.gradle b/android/app/build.gradle index 2e9a8c3eb..7acf3e4f6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -41,12 +41,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '17' } sourceSets { @@ -85,6 +85,10 @@ android { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig _storeFile != null ? signingConfigs.release : signingConfigs.debug + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) } debug { applicationIdSuffix ".debug" diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 000000000..c08da249a --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1 @@ +-keep class com.yalantis.ucrop.util.RectUtils { *; } \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9e7f5077e..b446a9c55 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -44,6 +44,9 @@ android:allowBackup="false" android:fullBackupContent="false" tools:replace="android:allowBackup"> + - if (project.extensions.findByName("android") != null) { + if (project.hasProperty('android')) { + project.android { + if (namespace == null) { + namespace project.group + } + } + + android { + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + jvmTarget = '17' + } + } + } + Integer pluginCompileSdk = project.android.compileSdk if (pluginCompileSdk != null) { if (pluginCompileSdk < 31) { @@ -34,18 +45,6 @@ subprojects { compileSdk 31 } } - if (pluginCompileSdk > 34) { - project.logger.error( - "Warning: Overriding compileSdk version in Flutter plugin: " - + project.name - + " from " - + pluginCompileSdk - + " to 34" - ) - project.android { - compileSdk 34 - } - } } } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef..92c1ac1bd 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 82a883bd0..745cfa379 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -10,13 +10,6 @@ pluginManagement { includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { - maven { url "https://maven.aliyun.com/repository/google" } - maven { url "https://maven.aliyun.com/repository/central" } - maven { url "https://maven.aliyun.com/repository/jcenter" } - maven { url "https://maven.aliyun.com/repository/public" } - maven { url "http://download.flutter.io" - allowInsecureProtocol = true - } google() mavenCentral() gradlePluginPortal() @@ -25,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.2.0" apply false + id "com.android.application" version '8.4.1' apply false id "org.jetbrains.kotlin.android" version "1.9.22" apply false } diff --git a/lib/common/skeleton/dynamic_card.dart b/lib/common/skeleton/dynamic_card.dart index 6893853ca..4c43e453a 100644 --- a/lib/common/skeleton/dynamic_card.dart +++ b/lib/common/skeleton/dynamic_card.dart @@ -15,7 +15,7 @@ class DynamicCardSkeleton extends StatelessWidget { border: Border( bottom: BorderSide( width: 8, - color: theme.dividerColor.withOpacity(0.05), + color: theme.dividerColor.withValues(alpha: 0.05), ), ), ), @@ -103,7 +103,7 @@ class DynamicCardSkeleton extends StatelessWidget { style: TextButton.styleFrom( padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), foregroundColor: - theme.colorScheme.outline.withOpacity(0.2), + theme.colorScheme.outline.withValues(alpha: 0.2), ), label: Text( i == 0 diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index c5c963af8..3f316b881 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -53,7 +53,7 @@ class PBadge extends StatelessWidget { bgColor = theme.primary; color = theme.onPrimary; case PBadgeType.secondary: - bgColor = theme.secondaryContainer.withOpacity(0.5); + bgColor = theme.secondaryContainer.withValues(alpha: 0.5); color = theme.onSecondaryContainer; case PBadgeType.gray: bgColor = Colors.black45; diff --git a/lib/common/widgets/custom_toast.dart b/lib/common/widgets/custom_toast.dart index dd88e641a..f6c473f82 100644 --- a/lib/common/widgets/custom_toast.dart +++ b/lib/common/widgets/custom_toast.dart @@ -16,7 +16,8 @@ class CustomToast extends StatelessWidget { EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30), padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10), decoration: BoxDecoration( - color: theme.colorScheme.primaryContainer.withOpacity(toastOpacity), + color: + theme.colorScheme.primaryContainer.withValues(alpha: toastOpacity), borderRadius: const BorderRadius.all(Radius.circular(20)), ), child: Text( diff --git a/lib/common/widgets/image/image_save.dart b/lib/common/widgets/image/image_save.dart index 364c4bbae..2fea87e2c 100644 --- a/lib/common/widgets/image/image_save.dart +++ b/lib/common/widgets/image/image_save.dart @@ -46,7 +46,7 @@ void imageSaveDialog({ width: 30, height: 30, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withValues(alpha: 0.3), shape: BoxShape.circle, ), child: IconButton( diff --git a/lib/common/widgets/image/image_view.dart b/lib/common/widgets/image/image_view.dart index 2b7be4c65..c31b1eeeb 100644 --- a/lib/common/widgets/image/image_view.dart +++ b/lib/common/widgets/image/image_view.dart @@ -149,7 +149,7 @@ Widget imageView( color: Theme.of(context) .colorScheme .onInverseSurface - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: borderRadius(index), ), child: Center( diff --git a/lib/common/widgets/image/network_img_layer.dart b/lib/common/widgets/image/network_img_layer.dart index 98a0582b8..27a74b021 100644 --- a/lib/common/widgets/image/network_img_layer.dart +++ b/lib/common/widgets/image/network_img_layer.dart @@ -88,7 +88,10 @@ class NetworkImgLayer extends StatelessWidget { clipBehavior: Clip.antiAlias, decoration: BoxDecoration( shape: type == ImageType.avatar ? BoxShape.circle : BoxShape.rectangle, - color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4), + color: Theme.of(context) + .colorScheme + .onInverseSurface + .withValues(alpha: 0.4), borderRadius: type == ImageType.avatar || type == ImageType.emote || radius == 0 ? null diff --git a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart index 77edf8d51..5de2fdeba 100644 --- a/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart +++ b/lib/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart @@ -324,7 +324,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/progress_bar/audio_video_progress_bar.dart b/lib/common/widgets/progress_bar/audio_video_progress_bar.dart index 93ce37ff3..a284e365b 100644 --- a/lib/common/widgets/progress_bar/audio_video_progress_bar.dart +++ b/lib/common/widgets/progress_bar/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/progress_bar/segment_progress_bar.dart b/lib/common/widgets/progress_bar/segment_progress_bar.dart index 4be67be52..9b3730515 100644 --- a/lib/common/widgets/progress_bar/segment_progress_bar.dart +++ b/lib/common/widgets/progress_bar/segment_progress_bar.dart @@ -89,7 +89,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/refresh_indicator.dart b/lib/common/widgets/refresh_indicator.dart index e3f13a7e4..6009bddf3 100644 --- a/lib/common/widgets/refresh_indicator.dart +++ b/lib/common/widgets/refresh_indicator.dart @@ -46,15 +46,25 @@ const Duration _kIndicatorScaleDuration = Duration(milliseconds: 200); /// Used by [RefreshIndicator.onRefresh]. typedef RefreshCallback = Future Function(); -// The state machine moves through these modes only when the scrollable -// identified by scrollableKey has been scrolled to its min or max limit. -enum _RefreshIndicatorMode { - drag, // Pointer is down. - armed, // Dragged far enough that an up event will run the onRefresh callback. - snap, // Animating to the indicator's final "displacement". - refresh, // Running the refresh callback. - done, // Animating the indicator's fade-out after refreshing. - canceled, // Animating the indicator's fade-out after not arming. +/// Indicates current status of Material `RefreshIndicator`. +enum RefreshIndicatorStatus { + /// Pointer is down. + drag, + + /// Dragged far enough that an up event will run the onRefresh callback. + armed, + + /// Animating to the indicator's final "displacement". + snap, + + /// Running the refresh callback. + refresh, + + /// Animating the indicator's fade-out after refreshing. + done, + + /// Animating the indicator's fade-out after not arming. + canceled, } /// Used to configure how [RefreshIndicator] can be triggered. @@ -68,7 +78,7 @@ enum RefreshIndicatorTriggerMode { onEdge, } -enum _IndicatorType { material, adaptive } +enum _IndicatorType { material, adaptive, noSpinner } /// A widget that supports the Material "swipe to refresh" idiom. /// @@ -96,6 +106,12 @@ enum _IndicatorType { material, adaptive } /// ** See code in examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart ** /// {@end-tool} /// +/// {@tool dartpad} +/// This example shows how to use [RefreshIndicator] without the spinner. +/// +/// ** See code in examples/api/lib/material/refresh_indicator/refresh_indicator.2.dart ** +/// {@end-tool} +/// /// ## Troubleshooting /// /// ### Refresh indicator does not show up @@ -149,7 +165,10 @@ class RefreshIndicator extends StatefulWidget { this.semanticsValue, this.strokeWidth = RefreshProgressIndicator.defaultStrokeWidth, this.triggerMode = RefreshIndicatorTriggerMode.onEdge, - }) : _indicatorType = _IndicatorType.material; + this.elevation = 2.0, + }) : _indicatorType = _IndicatorType.material, + onStatusChange = null, + assert(elevation >= 0.0); /// Creates an adaptive [RefreshIndicator] based on whether the target /// platform is iOS or macOS, following Material design's @@ -180,7 +199,35 @@ class RefreshIndicator extends StatefulWidget { this.semanticsValue, this.strokeWidth = RefreshProgressIndicator.defaultStrokeWidth, this.triggerMode = RefreshIndicatorTriggerMode.onEdge, - }) : _indicatorType = _IndicatorType.adaptive; + this.elevation = 2.0, + }) : _indicatorType = _IndicatorType.adaptive, + onStatusChange = null, + assert(elevation >= 0.0); + + /// Creates a [RefreshIndicator] with no spinner and calls `onRefresh` when + /// successfully armed by a drag event. + /// + /// Events can be optionally listened by using the `onStatusChange` callback. + const RefreshIndicator.noSpinner({ + super.key, + required this.child, + required this.onRefresh, + this.onStatusChange, + this.notificationPredicate = defaultScrollNotificationPredicate, + this.semanticsLabel, + this.semanticsValue, + this.triggerMode = RefreshIndicatorTriggerMode.onEdge, + this.elevation = 2.0, + }) : _indicatorType = _IndicatorType.noSpinner, + // The following parameters aren't used because [_IndicatorType.noSpinner] is being used, + // which involves showing no spinner, hence the following parameters are useless since + // their only use is to change the spinner's appearance. + displacement = 0.0, + edgeOffset = 0.0, + color = null, + backgroundColor = null, + strokeWidth = 0.0, + assert(elevation >= 0.0); /// The widget below this widget in the tree. /// @@ -220,6 +267,10 @@ class RefreshIndicator extends StatefulWidget { /// [Future] must complete when the refresh operation is finished. final RefreshCallback onRefresh; + /// Called to get the current status of the [RefreshIndicator] to update the UI as needed. + /// This is an optional parameter, used to fine tune app cases. + final ValueChanged? onStatusChange; + /// The progress indicator's foreground color. The current theme's /// [ColorScheme.primary] by default. final Color? color; @@ -266,6 +317,11 @@ class RefreshIndicator extends StatefulWidget { /// Defaults to [RefreshIndicatorTriggerMode.onEdge]. final RefreshIndicatorTriggerMode triggerMode; + /// Defines the elevation of the underlying [RefreshIndicator]. + /// + /// Defaults to 2.0. + final double elevation; + @override RefreshIndicatorState createState() => RefreshIndicatorState(); } @@ -281,7 +337,7 @@ class RefreshIndicatorState extends State late Animation _value; late Animation _valueColor; - _RefreshIndicatorMode? _mode; + RefreshIndicatorStatus? _status; late Future _pendingRefreshFuture; bool? _isIndicatorAtTop; double? _dragOffset; @@ -290,29 +346,37 @@ class RefreshIndicatorState extends State static final Animatable _threeQuarterTween = Tween(begin: 0.0, end: 0.75); - static final Animatable _kDragSizeFactorLimitTween = - Tween(begin: 0.0, end: _kDragSizeFactorLimit); + + static final Animatable _kDragSizeFactorLimitTween = Tween( + begin: 0.0, + end: _kDragSizeFactorLimit, + ); + static final Animatable _oneToZeroTween = Tween(begin: 1.0, end: 0.0); + @protected @override void initState() { super.initState(); _positionController = AnimationController(vsync: this); _positionFactor = _positionController.drive(_kDragSizeFactorLimitTween); - _value = _positionController.drive( - _threeQuarterTween); // The "value" of the circular progress indicator during a drag. + + // The "value" of the circular progress indicator during a drag. + _value = _positionController.drive(_threeQuarterTween); _scaleController = AnimationController(vsync: this); _scaleFactor = _scaleController.drive(_oneToZeroTween); } + @protected @override void didChangeDependencies() { _setupColorTween(); super.didChangeDependencies(); } + @protected @override void didUpdateWidget(covariant RefreshIndicator oldWidget) { super.didUpdateWidget(oldWidget); @@ -321,6 +385,7 @@ class RefreshIndicatorState extends State } } + @protected @override void dispose() { _positionController.dispose(); @@ -342,11 +407,8 @@ class RefreshIndicatorState extends State ColorTween( begin: color.withAlpha(0), end: color.withAlpha(color.alpha), - ).chain( - CurveTween( - curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit), - ), - ), + ).chain(CurveTween( + curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit))), ); } } @@ -364,7 +426,7 @@ class RefreshIndicatorState extends State notification.metrics.extentAfter == 0.0) || (notification.metrics.axisDirection == AxisDirection.down && notification.metrics.extentBefore == 0.0)) && - _mode == null && + _status == null && _start(notification.metrics.axisDirection); } @@ -374,7 +436,8 @@ class RefreshIndicatorState extends State } if (_shouldStart(notification)) { setState(() { - _mode = _RefreshIndicatorMode.drag; + _status = RefreshIndicatorStatus.drag; + widget.onStatusChange?.call(_status); }); return false; } @@ -384,13 +447,13 @@ class RefreshIndicatorState extends State AxisDirection.left || AxisDirection.right => null, }; if (indicatorAtTopNow != _isIndicatorAtTop) { - if (_mode == _RefreshIndicatorMode.drag || - _mode == _RefreshIndicatorMode.armed) { - _dismiss(_RefreshIndicatorMode.canceled); + if (_status == RefreshIndicatorStatus.drag || + _status == RefreshIndicatorStatus.armed) { + _dismiss(RefreshIndicatorStatus.canceled); } } else if (notification is ScrollUpdateNotification) { - if (_mode == _RefreshIndicatorMode.drag || - _mode == _RefreshIndicatorMode.armed) { + if (_status == RefreshIndicatorStatus.drag || + _status == RefreshIndicatorStatus.armed) { if (notification.metrics.axisDirection == AxisDirection.down) { _dragOffset = _dragOffset! - notification.scrollDelta!; } else if (notification.metrics.axisDirection == AxisDirection.up) { @@ -398,7 +461,7 @@ class RefreshIndicatorState extends State } _checkDragOffset(notification.metrics.viewportDimension); } - if (_mode == _RefreshIndicatorMode.armed && + if (_status == RefreshIndicatorStatus.armed && notification.dragDetails == null) { // On iOS start the refresh when the Scrollable bounces back from the // overscroll (ScrollNotification indicating this don't have dragDetails @@ -406,8 +469,8 @@ class RefreshIndicatorState extends State _show(); } } else if (notification is OverscrollNotification) { - if (_mode == _RefreshIndicatorMode.drag || - _mode == _RefreshIndicatorMode.armed) { + if (_status == RefreshIndicatorStatus.drag || + _status == RefreshIndicatorStatus.armed) { if (notification.metrics.axisDirection == AxisDirection.down) { _dragOffset = _dragOffset! - notification.overscroll; } else if (notification.metrics.axisDirection == AxisDirection.up) { @@ -416,19 +479,19 @@ class RefreshIndicatorState extends State _checkDragOffset(notification.metrics.viewportDimension); } } else if (notification is ScrollEndNotification) { - switch (_mode) { - case _RefreshIndicatorMode.armed: + switch (_status) { + case RefreshIndicatorStatus.armed: if (_positionController.value < 1.0) { - _dismiss(_RefreshIndicatorMode.canceled); + _dismiss(RefreshIndicatorStatus.canceled); } else { _show(); } - case _RefreshIndicatorMode.drag: - _dismiss(_RefreshIndicatorMode.canceled); - case _RefreshIndicatorMode.canceled: - case _RefreshIndicatorMode.done: - case _RefreshIndicatorMode.refresh: - case _RefreshIndicatorMode.snap: + case RefreshIndicatorStatus.drag: + _dismiss(RefreshIndicatorStatus.canceled); + case RefreshIndicatorStatus.canceled: + case RefreshIndicatorStatus.done: + case RefreshIndicatorStatus.refresh: + case RefreshIndicatorStatus.snap: case null: // do nothing break; @@ -442,7 +505,7 @@ class RefreshIndicatorState extends State if (notification.depth != 0 || !notification.leading) { return false; } - if (_mode == _RefreshIndicatorMode.drag) { + if (_status == RefreshIndicatorStatus.drag) { notification.disallowIndicator(); return true; } @@ -450,7 +513,7 @@ class RefreshIndicatorState extends State } bool _start(AxisDirection direction) { - assert(_mode == null); + assert(_status == null); assert(_isIndicatorAtTop == null); assert(_dragOffset == null); switch (direction) { @@ -470,74 +533,78 @@ class RefreshIndicatorState extends State } void _checkDragOffset(double containerExtent) { - assert(_mode == _RefreshIndicatorMode.drag || - _mode == _RefreshIndicatorMode.armed); + assert(_status == RefreshIndicatorStatus.drag || + _status == RefreshIndicatorStatus.armed); double newValue = _dragOffset! / (containerExtent * kDragContainerExtentPercentage); - if (_mode == _RefreshIndicatorMode.armed) { + if (_status == RefreshIndicatorStatus.armed) { newValue = math.max(newValue, 1.0 / _kDragSizeFactorLimit); } _positionController.value = - clampDouble(newValue, 0.0, 1.0); // this triggers various rebuilds - if (_mode == _RefreshIndicatorMode.drag && + clampDouble(newValue, 0.0, 1.0); // This triggers various rebuilds. + if (_status == RefreshIndicatorStatus.drag && _valueColor.value!.alpha == _effectiveValueColor.alpha) { - _mode = _RefreshIndicatorMode.armed; + _status = RefreshIndicatorStatus.armed; + widget.onStatusChange?.call(_status); } } // Stop showing the refresh indicator. - Future _dismiss(_RefreshIndicatorMode newMode) async { + Future _dismiss(RefreshIndicatorStatus newMode) async { await Future.value(); // This can only be called from _show() when refreshing and // _handleScrollNotification in response to a ScrollEndNotification or // direction change. - assert(newMode == _RefreshIndicatorMode.canceled || - newMode == _RefreshIndicatorMode.done); + assert(newMode == RefreshIndicatorStatus.canceled || + newMode == RefreshIndicatorStatus.done); setState(() { - _mode = newMode; + _status = newMode; + widget.onStatusChange?.call(_status); }); - switch (_mode!) { - case _RefreshIndicatorMode.done: + switch (_status!) { + case RefreshIndicatorStatus.done: await _scaleController.animateTo(1.0, duration: _kIndicatorScaleDuration); - case _RefreshIndicatorMode.canceled: + case RefreshIndicatorStatus.canceled: await _positionController.animateTo(0.0, duration: _kIndicatorScaleDuration); - case _RefreshIndicatorMode.armed: - case _RefreshIndicatorMode.drag: - case _RefreshIndicatorMode.refresh: - case _RefreshIndicatorMode.snap: + case RefreshIndicatorStatus.armed: + case RefreshIndicatorStatus.drag: + case RefreshIndicatorStatus.refresh: + case RefreshIndicatorStatus.snap: assert(false); } - if (mounted && _mode == newMode) { + if (mounted && _status == newMode) { _dragOffset = null; _isIndicatorAtTop = null; setState(() { - _mode = null; + _status = null; }); } } void _show() { - assert(_mode != _RefreshIndicatorMode.refresh); - assert(_mode != _RefreshIndicatorMode.snap); + assert(_status != RefreshIndicatorStatus.refresh); + assert(_status != RefreshIndicatorStatus.snap); final Completer completer = Completer(); _pendingRefreshFuture = completer.future; - _mode = _RefreshIndicatorMode.snap; + _status = RefreshIndicatorStatus.snap; + widget.onStatusChange?.call(_status); _positionController .animateTo(1.0 / _kDragSizeFactorLimit, duration: _kIndicatorSnapDuration) .then((void value) { - if (mounted && _mode == _RefreshIndicatorMode.snap) { + if (mounted && _status == RefreshIndicatorStatus.snap) { setState(() { // Show the indeterminate progress indicator. - _mode = _RefreshIndicatorMode.refresh; + _status = RefreshIndicatorStatus.refresh; }); - widget.onRefresh().whenComplete(() { - if (mounted && _mode == _RefreshIndicatorMode.refresh) { + final Future refreshResult = widget.onRefresh(); + refreshResult.whenComplete(() { + if (mounted && _status == RefreshIndicatorStatus.refresh) { completer.complete(); - _dismiss(_RefreshIndicatorMode.done); + _dismiss(RefreshIndicatorStatus.done); } }); } @@ -561,9 +628,9 @@ class RefreshIndicatorState extends State /// actual scroll view. It defaults to showing the indicator at the top. To /// show it at the bottom, set `atTop` to false. Future show({bool atTop = true}) { - if (_mode != _RefreshIndicatorMode.refresh && - _mode != _RefreshIndicatorMode.snap) { - if (_mode == null) { + if (_status != RefreshIndicatorStatus.refresh && + _status != RefreshIndicatorStatus.snap) { + if (_status == null) { _start(atTop ? AxisDirection.down : AxisDirection.up); } _show(); @@ -571,6 +638,7 @@ class RefreshIndicatorState extends State return _pendingRefreshFuture; } + @protected @override Widget build(BuildContext context) { assert(debugCheckHasMaterialLocalizations(context)); @@ -582,7 +650,7 @@ class RefreshIndicatorState extends State ), ); assert(() { - if (_mode == null) { + if (_status == null) { assert(_dragOffset == null); assert(_isIndicatorAtTop == null); } else { @@ -593,14 +661,14 @@ class RefreshIndicatorState extends State }()); final bool showIndeterminateIndicator = - _mode == _RefreshIndicatorMode.refresh || - _mode == _RefreshIndicatorMode.done; + _status == RefreshIndicatorStatus.refresh || + _status == RefreshIndicatorStatus.done; return Stack( clipBehavior: Clip.none, children: [ child, - if (_mode != null) + if (_status != null) Positioned( top: _isIndicatorAtTop! ? widget.edgeOffset : null, bottom: !_isIndicatorAtTop! ? widget.edgeOffset : null, @@ -608,41 +676,44 @@ class RefreshIndicatorState extends State right: 0.0, child: SizeTransition( axisAlignment: _isIndicatorAtTop! ? 1.0 : -1.0, - sizeFactor: _positionFactor, // this is what brings it down - child: Container( + sizeFactor: _positionFactor, // This is what brings it down. + child: Padding( padding: _isIndicatorAtTop! ? EdgeInsets.only(top: widget.displacement) : EdgeInsets.only(bottom: widget.displacement), - alignment: _isIndicatorAtTop! - ? Alignment.topCenter - : Alignment.bottomCenter, - child: ScaleTransition( - scale: _scaleFactor, - child: AnimatedBuilder( - animation: _positionController, - builder: (BuildContext context, Widget? child) { - final Widget materialIndicator = RefreshProgressIndicator( - semanticsLabel: widget.semanticsLabel ?? - MaterialLocalizations.of(context) - .refreshIndicatorSemanticLabel, - semanticsValue: widget.semanticsValue, - value: showIndeterminateIndicator ? null : _value.value, - valueColor: _valueColor, - backgroundColor: widget.backgroundColor, - strokeWidth: widget.strokeWidth, - ); + child: Align( + alignment: _isIndicatorAtTop! + ? Alignment.topCenter + : Alignment.bottomCenter, + child: ScaleTransition( + scale: _scaleFactor, + child: AnimatedBuilder( + animation: _positionController, + builder: (BuildContext context, Widget? child) { + final Widget materialIndicator = + RefreshProgressIndicator( + semanticsLabel: widget.semanticsLabel ?? + MaterialLocalizations.of(context) + .refreshIndicatorSemanticLabel, + semanticsValue: widget.semanticsValue, + value: + showIndeterminateIndicator ? null : _value.value, + valueColor: _valueColor, + backgroundColor: widget.backgroundColor, + strokeWidth: widget.strokeWidth, + elevation: widget.elevation, + ); - final Widget cupertinoIndicator = - CupertinoActivityIndicator( - color: widget.color, - ); + final Widget cupertinoIndicator = + CupertinoActivityIndicator( + color: widget.color, + ); - switch (widget._indicatorType) { - case _IndicatorType.material: - return materialIndicator; + switch (widget._indicatorType) { + case _IndicatorType.material: + return materialIndicator; - case _IndicatorType.adaptive: - { + case _IndicatorType.adaptive: final ThemeData theme = Theme.of(context); switch (theme.platform) { case TargetPlatform.android: @@ -654,9 +725,12 @@ class RefreshIndicatorState extends State case TargetPlatform.macOS: return cupertinoIndicator; } - } - } - }, + + case _IndicatorType.noSpinner: + return Container(); + } + }, + ), ), ), ), diff --git a/lib/common/widgets/stat/stat.dart b/lib/common/widgets/stat/stat.dart index 006ae4e74..53845887a 100644 --- a/lib/common/widgets/stat/stat.dart +++ b/lib/common/widgets/stat/stat.dart @@ -22,8 +22,10 @@ abstract class _StatItemBase extends StatelessWidget { Color get color { return textColor ?? switch (theme) { - '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), _ => Colors.white, }; } diff --git a/lib/common/widgets/tabs.dart b/lib/common/widgets/tabs.dart index 17a5340e0..9345095be 100644 --- a/lib/common/widgets/tabs.dart +++ b/lib/common/widgets/tabs.dart @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/foundation.dart'; +import 'dart:ui' show SemanticsRole; + +import 'package:flutter/foundation.dart' show clampDouble; import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart' hide TabBarView; @@ -124,11 +126,8 @@ class _CustomTabBarViewState extends State { _warpUnderwayCount -= 1; } - Future _animateToPage( - int page, { - required Duration duration, - required Curve curve, - }) async { + Future _animateToPage(int page, + {required Duration duration, required Curve curve}) async { _warpUnderwayCount += 1; await _pageController! .animateToPage(page, duration: duration, curve: curve); @@ -190,7 +189,11 @@ class _CustomTabBarViewState extends State { } void _updateChildren() { - _childrenWithKey = KeyedSubtree.ensureUniqueKeysForList(widget.children); + _childrenWithKey = KeyedSubtree.ensureUniqueKeysForList( + widget.children.map((Widget child) { + return Semantics(role: SemanticsRole.tabPanel, child: child); + }).toList(), + ); } void _handleTabControllerAnimationTick() { diff --git a/lib/common/widgets/video_card/video_card_v.dart b/lib/common/widgets/video_card/video_card_v.dart index 625cb3e02..e74f3e1fc 100644 --- a/lib/common/widgets/video_card/video_card_v.dart +++ b/lib/common/widgets/video_card/video_card_v.dart @@ -261,7 +261,7 @@ class VideoCardV extends StatelessWidget { TextSpan( style: TextStyle( fontSize: theme.textTheme.labelSmall!.fontSize, - color: theme.colorScheme.outline.withOpacity(0.8), + color: theme.colorScheme.outline.withValues(alpha: 0.8), ), text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)), ), @@ -275,7 +275,7 @@ class VideoCardV extends StatelessWidget { TextSpan( style: TextStyle( fontSize: theme.textTheme.labelSmall!.fontSize, - color: theme.colorScheme.outline.withOpacity(0.8), + color: theme.colorScheme.outline.withValues(alpha: 0.8), ), text: Utils.shortenChineseDateString( videoItem.desc!.split(' · ').last)), diff --git a/lib/pages/article/view.dart b/lib/pages/article/view.dart index e39537db8..d5056e7d5 100644 --- a/lib/pages/article/view.dart +++ b/lib/pages/article/view.dart @@ -263,7 +263,7 @@ class _ArticlePageState extends State SliverToBoxAdapter( child: Divider( thickness: 8, - color: theme.dividerColor.withOpacity(0.05), + color: theme.dividerColor.withValues(alpha: 0.05), ), ), _buildReplyHeader, @@ -303,7 +303,7 @@ class _ArticlePageState extends State ), VerticalDivider( thickness: 8, - color: theme.dividerColor.withOpacity(0.05), + color: theme.dividerColor.withValues(alpha: 0.05), ), Expanded( flex: _ratio[1].toInt(), @@ -847,7 +847,7 @@ class _ArticlePageState extends State border: Border( top: BorderSide( color: theme.colorScheme.outline - .withOpacity(0.08), + .withValues(alpha: 0.08), ), ), ), diff --git a/lib/pages/article_list/view.dart b/lib/pages/article_list/view.dart index 0c9f59ea3..5f84bec44 100644 --- a/lib/pages/article_list/view.dart +++ b/lib/pages/article_list/view.dart @@ -100,7 +100,7 @@ class _ArticleListPageState extends State { late final style = TextStyle(color: theme.colorScheme.onSurfaceVariant); late final divider = TextSpan( text: ' | ', - style: TextStyle(color: theme.colorScheme.outline.withOpacity(0.7)), + style: TextStyle(color: theme.colorScheme.outline.withValues(alpha: 0.7)), ); final padding = MediaQuery.paddingOf(context).top + kToolbarHeight; return SliverAppBar.medium( diff --git a/lib/pages/common/common_publish_page.dart b/lib/pages/common/common_publish_page.dart index 66e3cae1c..e231d9566 100644 --- a/lib/pages/common/common_publish_page.dart +++ b/lib/pages/common/common_publish_page.dart @@ -277,7 +277,7 @@ abstract class CommonPublishPageState Widget buildImage(int index, double height) { final color = - Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.5); + Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.5); void onClear() { pathList.removeAt(index); diff --git a/lib/pages/dynamics/widgets/additional_panel.dart b/lib/pages/dynamics/widgets/additional_panel.dart index ba712d95d..79fb2203e 100644 --- a/lib/pages/dynamics/widgets/additional_panel.dart +++ b/lib/pages/dynamics/widgets/additional_panel.dart @@ -13,7 +13,7 @@ Widget addWidget( ThemeData theme, DynamicItemModel item, BuildContext context, type, {floor = 1}) { late final Color bgColor = floor == 1 - ? theme.dividerColor.withOpacity(0.08) + ? theme.dividerColor.withValues(alpha: 0.08) : theme.colorScheme.surface; try { switch (type) { @@ -131,13 +131,13 @@ Widget addWidget( ? null : isReserved ? theme.colorScheme.onSurface - .withOpacity(0.38) + .withValues(alpha: 0.38) : null, backgroundColor: canJump ? null : isReserved ? theme.colorScheme.onSurface - .withOpacity(0.12) + .withValues(alpha: 0.12) : null, visualDensity: VisualDensity.compact, padding: const EdgeInsets.symmetric( @@ -322,7 +322,7 @@ Widget addWidget( decoration: BoxDecoration( color: floor == 1 ? theme.colorScheme.surface - : theme.dividerColor.withOpacity(0.08), + : theme.dividerColor.withValues(alpha: 0.08), borderRadius: const BorderRadius.all(Radius.circular(8)), ), diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index fe3e00d44..a588c5a52 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -86,7 +86,7 @@ class DynamicPanel extends StatelessWidget { border: Border( bottom: BorderSide( width: 8, - color: theme.dividerColor.withOpacity(0.05), + color: theme.dividerColor.withValues(alpha: 0.05), ), ), ), diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart index 9f0b6de85..22603e5ea 100644 --- a/lib/pages/dynamics/widgets/forward_panel.dart +++ b/lib/pages/dynamics/widgets/forward_panel.dart @@ -209,7 +209,7 @@ Widget forWard( }, child: Container( padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8), - color: theme.dividerColor.withOpacity(0.08), + color: theme.dividerColor.withValues(alpha: 0.08), child: forWard(theme, isSave, item.orig!, context, source, callback, floor: floor + 1), ), @@ -329,7 +329,7 @@ Widget forWard( width: double.infinity, padding: const EdgeInsets.only(left: 12, top: 10, right: 12, bottom: 10), - color: theme.dividerColor.withOpacity(0.08), + color: theme.dividerColor.withValues(alpha: 0.08), child: Row( children: [ NetworkImgLayer( @@ -378,7 +378,7 @@ Widget forWard( width: double.infinity, padding: const EdgeInsets.only(left: 12, top: 10, right: 12, bottom: 10), - color: theme.dividerColor.withOpacity(0.08), + color: theme.dividerColor.withValues(alpha: 0.08), child: Row( children: [ NetworkImgLayer( diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index 8bc700874..3c8455251 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -192,7 +192,7 @@ class _UpPanelState extends State { (data.type == 'up' && (data.hasUpdate ?? false)), backgroundColor: data.type == 'live' ? theme.colorScheme.secondaryContainer - .withOpacity(0.75) + .withValues(alpha: 0.75) : theme.colorScheme.primary, ), ), diff --git a/lib/pages/dynamics_detail/view.dart b/lib/pages/dynamics_detail/view.dart index 26ec5d1a2..4bdd653b1 100644 --- a/lib/pages/dynamics_detail/view.dart +++ b/lib/pages/dynamics_detail/view.dart @@ -509,7 +509,7 @@ class _DynamicDetailPageState extends State border: Border( top: BorderSide( color: theme.colorScheme.outline - .withOpacity(0.08), + .withValues(alpha: 0.08), ), ), ), diff --git a/lib/pages/dynamics_repost/view.dart b/lib/pages/dynamics_repost/view.dart index 9cf989ee5..39fd6a1d3 100644 --- a/lib/pages/dynamics_repost/view.dart +++ b/lib/pages/dynamics_repost/view.dart @@ -321,7 +321,7 @@ class _RepostPanelState extends CommonPublishPageState { const SizedBox(height: 10), Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ListTile( dense: true, diff --git a/lib/pages/emote/view.dart b/lib/pages/emote/view.dart index 08b600ac0..2965bd0b1 100644 --- a/lib/pages/emote/view.dart +++ b/lib/pages/emote/view.dart @@ -97,7 +97,7 @@ class _EmotePanelState extends State ), Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), Row( children: [ @@ -105,8 +105,8 @@ class _EmotePanelState extends State padding: const EdgeInsets.symmetric(horizontal: 10), child: iconButton( iconSize: 20, - iconColor: - theme.colorScheme.onSurfaceVariant.withOpacity(0.8), + iconColor: theme.colorScheme.onSurfaceVariant + .withValues(alpha: 0.8), bgColor: Colors.transparent, context: context, onPressed: () { diff --git a/lib/pages/episode_panel/view.dart b/lib/pages/episode_panel/view.dart index ba25513a0..96af6da1a 100644 --- a/lib/pages/episode_panel/view.dart +++ b/lib/pages/episode_panel/view.dart @@ -209,7 +209,7 @@ class _EpisodePanelState extends CommonSlidePageState isScrollable: true, tabs: widget.list.map((item) => Tab(text: item.title)).toList(), dividerHeight: 1, - dividerColor: theme.dividerColor.withOpacity(0.1), + dividerColor: theme.dividerColor.withValues(alpha: 0.1), ), Expanded( child: Material( @@ -557,7 +557,7 @@ class _EpisodePanelState extends CommonSlidePageState decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), ), ), diff --git a/lib/pages/fav/note/child_view.dart b/lib/pages/fav/note/child_view.dart index 3d4138712..dd65082e4 100644 --- a/lib/pages/fav/note/child_view.dart +++ b/lib/pages/fav/note/child_view.dart @@ -58,7 +58,7 @@ class _FavNoteChildPageState extends State border: Border( top: BorderSide( width: 0.5, - color: theme.colorScheme.outline.withOpacity(0.5), + color: theme.colorScheme.outline.withValues(alpha: 0.5), ), ), ), diff --git a/lib/pages/fav/note/widget/item.dart b/lib/pages/fav/note/widget/item.dart index e8e041d0c..c6e86b64a 100644 --- a/lib/pages/fav/note/widget/item.dart +++ b/lib/pages/fav/note/widget/item.dart @@ -119,7 +119,8 @@ class FavNoteItem extends StatelessWidget { StyleString.aspectRatio, decoration: BoxDecoration( borderRadius: StyleString.mdRadius, - color: Colors.black.withOpacity(0.6), + color: + Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -138,7 +139,7 @@ class FavNoteItem extends StatelessWidget { WidgetStateProperty.resolveWith( (states) { return theme.colorScheme.surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/fav/pgc/child_view.dart b/lib/pages/fav/pgc/child_view.dart index 3a7577775..511479544 100644 --- a/lib/pages/fav/pgc/child_view.dart +++ b/lib/pages/fav/pgc/child_view.dart @@ -65,7 +65,7 @@ class _FavPgcChildPageState extends State border: Border( top: BorderSide( width: 0.5, - color: theme.colorScheme.outline.withOpacity(0.5), + color: theme.colorScheme.outline.withValues(alpha: 0.5), ), ), ), diff --git a/lib/pages/fav/pgc/widget/item.dart b/lib/pages/fav/pgc/widget/item.dart index 054900ce8..627e40969 100644 --- a/lib/pages/fav/pgc/widget/item.dart +++ b/lib/pages/fav/pgc/widget/item.dart @@ -93,7 +93,8 @@ class FavPgcItem extends StatelessWidget { decoration: BoxDecoration( borderRadius: const BorderRadius.all( Radius.circular(4)), - color: Colors.black.withOpacity(0.6), + color: + Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -114,7 +115,7 @@ class FavPgcItem extends StatelessWidget { (states) { return theme .colorScheme.surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 38836b558..3b7f9928b 100644 --- a/lib/pages/fav_detail/view.dart +++ b/lib/pages/fav_detail/view.dart @@ -454,7 +454,7 @@ class _FavDetailPageState extends State { StyleString.aspectRatio, decoration: BoxDecoration( borderRadius: StyleString.mdRadius, - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -472,7 +472,7 @@ class _FavDetailPageState extends State { WidgetStateProperty.resolveWith( (states) { return theme.colorScheme.surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/fav_panel/view.dart b/lib/pages/fav_panel/view.dart index 204845bd4..0142da32a 100644 --- a/lib/pages/fav_panel/view.dart +++ b/lib/pages/fav_panel/view.dart @@ -153,7 +153,7 @@ class _FavPanelState extends State { ), Divider( height: 1, - color: theme.disabledColor.withOpacity(0.08), + color: theme.disabledColor.withValues(alpha: 0.08), ), Padding( padding: EdgeInsets.only( diff --git a/lib/pages/group_panel/view.dart b/lib/pages/group_panel/view.dart index 8c4b85156..a652a725d 100644 --- a/lib/pages/group_panel/view.dart +++ b/lib/pages/group_panel/view.dart @@ -160,7 +160,7 @@ class _GroupPanelState extends State { ), Divider( height: 1, - color: theme.disabledColor.withOpacity(0.08), + color: theme.disabledColor.withValues(alpha: 0.08), ), Padding( padding: EdgeInsets.only( diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index 8728d18ac..96323c07f 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -190,7 +190,7 @@ class HistoryItem extends StatelessWidget { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: StyleString.mdRadius, - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -208,7 +208,7 @@ class HistoryItem extends StatelessWidget { WidgetStateProperty.resolveWith( (states) { return theme.colorScheme.surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index 3356c532a..35daa9aeb 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -111,7 +111,7 @@ class _HomePageState extends State onTap: () => _homeController.showUserInfoDialog(context), splashColor: theme.colorScheme.primaryContainer - .withOpacity(0.3), + .withValues(alpha: 0.3), borderRadius: const BorderRadius.all( Radius.circular(50), ), @@ -187,9 +187,10 @@ class _HomePageState extends State borderRadius: BorderRadius.all(Radius.circular(25)), ), child: Material( - color: theme.colorScheme.onSecondaryContainer.withOpacity(0.05), + color: theme.colorScheme.onSecondaryContainer.withValues(alpha: 0.05), child: InkWell( - splashColor: theme.colorScheme.primaryContainer.withOpacity(0.3), + splashColor: + theme.colorScheme.primaryContainer.withValues(alpha: 0.3), onTap: () => Get.toNamed( '/search', parameters: { diff --git a/lib/pages/later/child_view.dart b/lib/pages/later/child_view.dart index a412f6585..b0168bf63 100644 --- a/lib/pages/later/child_view.dart +++ b/lib/pages/later/child_view.dart @@ -132,7 +132,7 @@ class _LaterViewChildPageState extends State StyleString.aspectRatio, decoration: BoxDecoration( borderRadius: StyleString.mdRadius, - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), ), child: SizedBox( width: 34, @@ -150,7 +150,7 @@ class _LaterViewChildPageState extends State WidgetStateProperty.resolveWith( (states) { return theme.colorScheme.surface - .withOpacity(0.8); + .withValues(alpha: 0.8); }, ), ), diff --git a/lib/pages/live_emote/view.dart b/lib/pages/live_emote/view.dart index ce53f7b4b..365be55d7 100644 --- a/lib/pages/live_emote/view.dart +++ b/lib/pages/live_emote/view.dart @@ -108,7 +108,7 @@ class _LiveEmotePanelState 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/live_room/send_danmaku/view.dart b/lib/pages/live_room/send_danmaku/view.dart index c28af9fc4..3d3157a54 100644 --- a/lib/pages/live_room/send_danmaku/view.dart +++ b/lib/pages/live_room/send_danmaku/view.dart @@ -134,7 +134,7 @@ class _ReplyPageState extends CommonPublishPageState { ), Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), Container( height: 52, diff --git a/lib/pages/live_room/widgets/bottom_control.dart b/lib/pages/live_room/widgets/bottom_control.dart index d579a63af..949c927d6 100644 --- a/lib/pages/live_room/widgets/bottom_control.dart +++ b/lib/pages/live_room/widgets/bottom_control.dart @@ -73,7 +73,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { alignment: Alignment.center, child: PopupMenuButton( initialValue: plPlayerController.videoFit.value, - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return BoxFit.values.map((BoxFit boxFit) { return PopupMenuItem( @@ -105,7 +105,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { child: PopupMenuButton( padding: EdgeInsets.zero, initialValue: liveRoomCtr.currentQn, - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), child: Text( liveRoomCtr.currentQnDesc.value, style: const TextStyle(color: Colors.white, fontSize: 13), diff --git a/lib/pages/live_room/widgets/chat.dart b/lib/pages/live_room/widgets/chat.dart index 0f9afd951..4a605fe78 100644 --- a/lib/pages/live_room/widgets/chat.dart +++ b/lib/pages/live_room/widgets/chat.dart @@ -40,7 +40,7 @@ class LiveRoomChat extends StatelessWidget { const EdgeInsets.symmetric(horizontal: 10, vertical: 5), decoration: BoxDecoration( color: isPP == true - ? Colors.black.withOpacity(0.3) + ? Colors.black.withValues(alpha: 0.3) : const Color(0x15FFFFFF), borderRadius: const BorderRadius.all(Radius.circular(18)), ), @@ -51,7 +51,7 @@ class LiveRoomChat extends StatelessWidget { text: '${liveRoomController.messages[index]['name']}: ', style: TextStyle( - color: Colors.white.withOpacity(0.6), + color: Colors.white.withValues(alpha: 0.6), fontSize: 14, ), recognizer: TapGestureRecognizer() diff --git a/lib/pages/live_search/child/view.dart b/lib/pages/live_search/child/view.dart index 27f33fc68..290c36a27 100644 --- a/lib/pages/live_search/child/view.dart +++ b/lib/pages/live_search/child/view.dart @@ -2,7 +2,6 @@ import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/skeleton/msg_feed_top.dart'; import 'package:PiliPlus/common/skeleton/video_card_v.dart'; import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart'; -import 'package:PiliPlus/common/widgets/refresh_indicator.dart'; import 'package:PiliPlus/http/loading_state.dart'; import 'package:PiliPlus/models/common/live_search_type.dart'; import 'package:PiliPlus/pages/live_search/child/controller.dart'; @@ -37,7 +36,7 @@ class _LiveSearchChildPageState extends State Widget build(BuildContext context) { super.build(context); double padding = widget.searchType == LiveSearchType.room ? 12 : 0; - return refreshIndicator( + return RefreshIndicator( onRefresh: _controller.onRefresh, child: CustomScrollView( controller: _controller.scrollController, diff --git a/lib/pages/login/view.dart b/lib/pages/login/view.dart index fc0f3fd7d..d562ef7f2 100644 --- a/lib/pages/login/view.dart +++ b/lib/pages/login/view.dart @@ -122,14 +122,16 @@ class _LoginPageState extends State { const EdgeInsets.symmetric(horizontal: 20, vertical: 20), child: Text(_loginPageCtr.codeInfo['data']?['url'] ?? "", style: theme.textTheme.labelSmall!.copyWith( - color: theme.colorScheme.onSurface.withOpacity(0.4))), + color: theme.colorScheme.onSurface + .withValues(alpha: 0.4))), ), )), Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: Text('请务必在 PiliPlus 开源仓库等可信渠道下载安装。', style: theme.textTheme.labelSmall!.copyWith( - color: theme.colorScheme.onSurface.withOpacity(0.4)))), + color: + theme.colorScheme.onSurface.withValues(alpha: 0.4)))), ], ); } @@ -313,7 +315,8 @@ class _LoginPageState extends State { '请务必在 PiliPlus 开源仓库等可信渠道下载安装。', textAlign: TextAlign.center, style: theme.textTheme.labelSmall!.copyWith( - color: theme.colorScheme.onSurface.withOpacity(0.4)))), + color: + theme.colorScheme.onSurface.withValues(alpha: 0.4)))), ], ); } @@ -329,7 +332,7 @@ class _LoginPageState extends State { child: DecoratedBox( decoration: UnderlineTabIndicator( borderSide: BorderSide( - color: theme.colorScheme.outline.withOpacity(0.4)), + color: theme.colorScheme.outline.withValues(alpha: 0.4)), ), child: Row( children: [ @@ -370,7 +373,7 @@ class _LoginPageState extends State { SizedBox( height: 24, child: VerticalDivider( - color: theme.colorScheme.outline.withOpacity(0.5), + color: theme.colorScheme.outline.withValues(alpha: 0.5), ), ), const SizedBox(width: 6), @@ -398,7 +401,7 @@ class _LoginPageState extends State { child: DecoratedBox( decoration: UnderlineTabIndicator( borderSide: BorderSide( - color: theme.colorScheme.outline.withOpacity(0.4)), + color: theme.colorScheme.outline.withValues(alpha: 0.4)), ), child: Row( children: [ @@ -443,7 +446,8 @@ class _LoginPageState extends State { '请务必在 PiliPlus 开源仓库等可信渠道下载安装。', textAlign: TextAlign.center, style: theme.textTheme.labelSmall!.copyWith( - color: theme.colorScheme.onSurface.withOpacity(0.4)))), + color: + theme.colorScheme.onSurface.withValues(alpha: 0.4)))), ], ); } diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index d626630b1..1dd4086b4 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -301,7 +301,7 @@ class _MainAppState extends State width: 1, indent: MediaQuery.of(context).padding.top, endIndent: MediaQuery.of(context).padding.bottom, - color: theme.colorScheme.outline.withOpacity(0.06), + color: theme.colorScheme.outline.withValues(alpha: 0.06), ), ], Expanded( @@ -448,7 +448,7 @@ class _MainAppState extends State onTap: () => _homeController.showUserInfoDialog(context), splashColor: theme.colorScheme.primaryContainer - .withOpacity(0.3), + .withValues(alpha: 0.3), borderRadius: const BorderRadius.all( Radius.circular(50), ), diff --git a/lib/pages/media/view.dart b/lib/pages/media/view.dart index 5964ef0a2..e995b0786 100644 --- a/lib/pages/media/view.dart +++ b/lib/pages/media/view.dart @@ -111,7 +111,7 @@ class _MediaPageState extends CommonPageState children: [ Divider( height: 20, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), ListTile( onTap: () async { @@ -193,7 +193,7 @@ class _MediaPageState extends CommonPageState backgroundColor: WidgetStateProperty.resolveWith((states) { return theme.colorScheme.primaryContainer - .withOpacity(0.5); + .withValues(alpha: 0.5); }), ), onPressed: () async { @@ -282,10 +282,12 @@ class FavFolderItem extends StatelessWidget { clipBehavior: Clip.hardEdge, decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(12)), - color: theme.colorScheme.onInverseSurface.withOpacity(0.4), + color: + theme.colorScheme.onInverseSurface.withValues(alpha: 0.4), boxShadow: [ BoxShadow( - color: theme.colorScheme.onInverseSurface.withOpacity(0.4), + color: theme.colorScheme.onInverseSurface + .withValues(alpha: 0.4), offset: const Offset(4, -12), blurRadius: 0.0, spreadRadius: 0.0, diff --git a/lib/pages/member/widget/user_info_card.dart b/lib/pages/member/widget/user_info_card.dart index 331efe20b..085b35a8b 100644 --- a/lib/pages/member/widget/user_info_card.dart +++ b/lib/pages/member/widget/user_info_card.dart @@ -212,7 +212,7 @@ class UserInfoCard extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: theme.colorScheme.onSurface.withOpacity(0.7), + color: theme.colorScheme.onSurface.withValues(alpha: 0.7), ), ) ], @@ -357,7 +357,7 @@ class UserInfoCard extends StatelessWidget { style: IconButton.styleFrom( side: BorderSide( width: 1.0, - color: theme.colorScheme.outline.withOpacity(0.5), + color: theme.colorScheme.outline.withValues(alpha: 0.5), ), padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, diff --git a/lib/pages/member_profile/view.dart b/lib/pages/member_profile/view.dart index 0e9311b7f..9e5b4a1dd 100644 --- a/lib/pages/member_profile/view.dart +++ b/lib/pages/member_profile/view.dart @@ -80,12 +80,12 @@ class _EditProfilePageState extends State { Widget _buildBody(ThemeData theme, LoadingState loadingState) { late final divider = Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ); late final divider1 = Divider( thickness: 16, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ); return switch (loadingState) { diff --git a/lib/pages/msg_feed_top/at_me/view.dart b/lib/pages/msg_feed_top/at_me/view.dart index deb5e5444..3346db379 100644 --- a/lib/pages/msg_feed_top/at_me/view.dart +++ b/lib/pages/msg_feed_top/at_me/view.dart @@ -42,7 +42,7 @@ class _AtMePageState extends State { icon: Icon( size: 20, Icons.settings, - color: theme.colorScheme.onSurfaceVariant.withOpacity(0.8), + color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.8), ), ), const SizedBox(width: 10), @@ -162,7 +162,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 2d6b859fa..3c26623e6 100644 --- a/lib/pages/msg_feed_top/like_me/view.dart +++ b/lib/pages/msg_feed_top/like_me/view.dart @@ -43,7 +43,7 @@ class _LikeMePageState extends State { icon: Icon( size: 20, Icons.settings, - color: theme.colorScheme.onSurfaceVariant.withOpacity(0.8), + color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.8), ), ), const SizedBox(width: 10), @@ -106,7 +106,7 @@ class _LikeMePageState extends State { indent: 72, endIndent: 20, height: 6, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ); }, ), @@ -136,7 +136,7 @@ class _LikeMePageState 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/reply_me/view.dart b/lib/pages/msg_feed_top/reply_me/view.dart index 822f5df16..7e1612a24 100644 --- a/lib/pages/msg_feed_top/reply_me/view.dart +++ b/lib/pages/msg_feed_top/reply_me/view.dart @@ -42,7 +42,7 @@ class _ReplyMePageState extends State { icon: Icon( size: 20, Icons.settings, - color: theme.colorScheme.onSurfaceVariant.withOpacity(0.8), + color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.8), ), ), const SizedBox(width: 10), @@ -175,7 +175,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 0d679ac4c..2fa999fe3 100644 --- a/lib/pages/msg_feed_top/sys_msg/view.dart +++ b/lib/pages/msg_feed_top/sys_msg/view.dart @@ -100,7 +100,8 @@ class _SysMsgPageState extends State { _buildContent(theme, content ?? ''), style: TextStyle( fontSize: 14, - color: theme.colorScheme.onSurface.withOpacity(0.85), + color: theme.colorScheme.onSurface + .withValues(alpha: 0.85), ), ), const SizedBox(height: 5), @@ -126,7 +127,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 a8feae581..f3135ba20 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -33,7 +33,7 @@ class _SearchPageState extends State { appBar: AppBar( shape: Border( bottom: BorderSide( - color: theme.dividerColor.withOpacity(0.08), + color: theme.dividerColor.withValues(alpha: 0.08), width: 1, ), ), @@ -338,7 +338,7 @@ class _SearchPageState extends State { } Icon historyIcon(ThemeData theme) => Icon(Icons.history, - color: theme.colorScheme.onSurfaceVariant.withOpacity(0.8)); + color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.8)); Widget _buildHotKey( LoadingState loadingState, bool isHot) { diff --git a/lib/pages/search_panel/video/controller.dart b/lib/pages/search_panel/video/controller.dart index 609feb982..afd36d753 100644 --- a/lib/pages/search_panel/video/controller.dart +++ b/lib/pages/search_panel/video/controller.dart @@ -202,11 +202,11 @@ class SearchVideoController bgColor: currentPubTimeFilter == -1 && (isFirst ? customPubBeginDate : customPubEndDate) ? theme.colorScheme.secondaryContainer - : theme.colorScheme.outline.withOpacity(0.1), + : theme.colorScheme.outline.withValues(alpha: 0.1), textColor: currentPubTimeFilter == -1 && (isFirst ? customPubBeginDate : customPubEndDate) ? theme.colorScheme.onSecondaryContainer - : theme.colorScheme.outline.withOpacity(0.8), + : theme.colorScheme.outline.withValues(alpha: 0.8), ); } diff --git a/lib/pages/search_result/view.dart b/lib/pages/search_result/view.dart index 357a863b2..f64af7f89 100644 --- a/lib/pages/search_result/view.dart +++ b/lib/pages/search_result/view.dart @@ -68,7 +68,7 @@ class _SearchResultPageState extends State appBar: AppBar( shape: Border( bottom: BorderSide( - color: theme.dividerColor.withOpacity(0.08), + color: theme.dividerColor.withValues(alpha: 0.08), width: 1, ), ), diff --git a/lib/pages/search_trending/view.dart b/lib/pages/search_trending/view.dart index 998ae2cd7..b0175a67c 100644 --- a/lib/pages/search_trending/view.dart +++ b/lib/pages/search_trending/view.dart @@ -79,8 +79,8 @@ class _SearchTrendingPageState extends State { ), ), ), - backgroundColor: - theme.colorScheme.surface.withOpacity(_scrollRatio.value), + backgroundColor: theme.colorScheme.surface + .withValues(alpha: _scrollRatio.value), foregroundColor: flag ? null : Colors.white, systemOverlayStyle: flag ? null @@ -93,7 +93,8 @@ class _SearchTrendingPageState extends State { preferredSize: const Size.fromHeight(1), child: Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: + theme.colorScheme.outline.withValues(alpha: 0.1), ), ) : null, @@ -214,7 +215,7 @@ class _SearchTrendingPageState extends State { separatorBuilder: (context, index) => Divider( height: 1, indent: 48, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ), ) diff --git a/lib/pages/setting/pages/color_select.dart b/lib/pages/setting/pages/color_select.dart index 687a19b54..c09e5443f 100644 --- a/lib/pages/setting/pages/color_select.dart +++ b/lib/pages/setting/pages/color_select.dart @@ -118,7 +118,8 @@ class _ColorSelectPageState extends State { height: 1, fontSize: 13, color: ctr.type.value == 0 - ? theme.colorScheme.outline.withOpacity(0.8) + ? theme.colorScheme.outline + .withValues(alpha: 0.8) : theme.colorScheme.secondary, ), strutStyle: const StrutStyle(leading: 0, height: 1), @@ -127,7 +128,8 @@ class _ColorSelectPageState extends State { size: 20, Icons.keyboard_arrow_right, color: ctr.type.value == 0 - ? theme.colorScheme.outline.withOpacity(0.8) + ? theme.colorScheme.outline + .withValues(alpha: 0.8) : theme.colorScheme.secondary, ) ], @@ -201,14 +203,14 @@ class _ColorSelectPageState extends State { width: 46, height: 46, decoration: BoxDecoration( - color: e['color'].withOpacity(0.8), + color: e['color'].withValues(alpha: 0.8), borderRadius: const BorderRadius.all( Radius.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 499fa52d1..79bf9aa8e 100644 --- a/lib/pages/setting/pages/font_size_select.dart +++ b/lib/pages/setting/pages/font_size_select.dart @@ -67,7 +67,8 @@ class _FontSizeSelectPageState extends State { decoration: BoxDecoration( border: Border( top: BorderSide( - color: theme.colorScheme.primary.withOpacity(0.3))), + color: + theme.colorScheme.primary.withValues(alpha: 0.3))), color: theme.colorScheme.surface, ), child: Row( diff --git a/lib/pages/setting/recommend_setting.dart b/lib/pages/setting/recommend_setting.dart index 109bf8f78..9aee7203d 100644 --- a/lib/pages/setting/recommend_setting.dart +++ b/lib/pages/setting/recommend_setting.dart @@ -21,8 +21,8 @@ class RecommendSetting extends StatelessWidget { '* 其它(如热门视频、手动搜索、链接跳转等)均不受过滤器影响。\n' '* 设定较严苛的条件可导致推荐项数锐减或多次请求,请酌情选择。\n' '* 后续可能会增加更多过滤条件,敬请期待。', - style: theme.textTheme.labelSmall! - .copyWith(color: theme.colorScheme.outline.withOpacity(0.7)), + style: theme.textTheme.labelSmall!.copyWith( + color: theme.colorScheme.outline.withValues(alpha: 0.7)), ), ), SizedBox(height: MediaQuery.paddingOf(context).bottom + 80), diff --git a/lib/pages/setting/view.dart b/lib/pages/setting/view.dart index 96297fdf7..861d6a215 100644 --- a/lib/pages/setting/view.dart +++ b/lib/pages/setting/view.dart @@ -127,7 +127,7 @@ class _SettingPageState extends State { ), VerticalDivider( width: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), Expanded( flex: 6, diff --git a/lib/pages/share/view.dart b/lib/pages/share/view.dart index 1d1c7d481..f21080b54 100644 --- a/lib/pages/share/view.dart +++ b/lib/pages/share/view.dart @@ -149,7 +149,7 @@ class _SharePanelState extends State { height: 50, decoration: BoxDecoration( color: theme.colorScheme.primary - .withOpacity(0.3), + .withValues(alpha: 0.3), shape: BoxShape.circle, border: Border.all( width: 1.5, diff --git a/lib/pages/sponsor_block/view.dart b/lib/pages/sponsor_block/view.dart index a29c048df..22e24f71b 100644 --- a/lib/pages/sponsor_block/view.dart +++ b/lib/pages/sponsor_block/view.dart @@ -372,14 +372,14 @@ class _SponsorBlockPageState extends State { final divider = SliverToBoxAdapter( child: Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ); final dividerL = SliverToBoxAdapter( child: Divider( thickness: 16, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ); @@ -505,7 +505,8 @@ class _SponsorBlockPageState extends State { fontSize: 14, color: _blockSettings[index].second == SkipType.disable - ? theme.colorScheme.outline.withOpacity(0.7) + ? theme.colorScheme.outline + .withValues(alpha: 0.7) : theme.colorScheme.secondary, ), strutStyle: const StrutStyle(height: 1, leading: 0), @@ -515,7 +516,8 @@ class _SponsorBlockPageState extends State { size: MediaQuery.textScalerOf(context).scale(14), color: _blockSettings[index].second == SkipType.disable - ? theme.colorScheme.outline.withOpacity(0.7) + ? theme.colorScheme.outline + .withValues(alpha: 0.7) : theme.colorScheme.secondary, ), ], @@ -536,7 +538,7 @@ class _SponsorBlockPageState extends State { ), separatorBuilder: (context, index) => Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ), dividerL, diff --git a/lib/pages/subscription_detail/view.dart b/lib/pages/subscription_detail/view.dart index e974101a4..afcf2ca35 100644 --- a/lib/pages/subscription_detail/view.dart +++ b/lib/pages/subscription_detail/view.dart @@ -128,7 +128,7 @@ class _SubDetailPageState extends State { decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: theme.dividerColor.withOpacity(0.2), + color: theme.dividerColor.withValues(alpha: 0.2), ), ), ), diff --git a/lib/pages/video/ai/view.dart b/lib/pages/video/ai/view.dart index 9257acb10..e46c412e1 100644 --- a/lib/pages/video/ai/view.dart +++ b/lib/pages/video/ai/view.dart @@ -73,7 +73,7 @@ class _AiDetailState extends CommonCollapseSlidePageState { SliverToBoxAdapter( child: Divider( height: 20, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), thickness: 6, ), ), diff --git a/lib/pages/video/controller.dart b/lib/pages/video/controller.dart index c23fc7823..02c530b26 100644 --- a/lib/pages/video/controller.dart +++ b/lib/pages/video/controller.dart @@ -638,7 +638,7 @@ class VideoDetailController extends GetxController color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), ) @@ -856,7 +856,7 @@ class VideoDetailController extends GetxController bgColor: Theme.of(Get.context!) .colorScheme .secondaryContainer - .withOpacity(0.8), + .withValues(alpha: 0.8), textColor: Theme.of(Get.context!).colorScheme.onSecondaryContainer, padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), @@ -1472,7 +1472,7 @@ class VideoDetailController extends GetxController return Segment( start, start, - Colors.black.withOpacity(0.5), + Colors.black.withValues(alpha: 0.5), item?['content'], item?['imgUrl'], item?['from'], diff --git a/lib/pages/video/introduction/pgc/widgets/intro_detail.dart b/lib/pages/video/introduction/pgc/widgets/intro_detail.dart index 81e077b61..7bdde4557 100644 --- a/lib/pages/video/introduction/pgc/widgets/intro_detail.dart +++ b/lib/pages/video/introduction/pgc/widgets/intro_detail.dart @@ -38,8 +38,8 @@ class _IntroDetailState extends CommonCollapseSlidePageState { width: 32, height: 3, decoration: BoxDecoration( - color: - theme.colorScheme.onSecondaryContainer.withOpacity(0.5), + color: theme.colorScheme.onSecondaryContainer + .withValues(alpha: 0.5), borderRadius: const BorderRadius.all(Radius.circular(3))), ), ), diff --git a/lib/pages/video/introduction/ugc/widgets/action_row_item.dart b/lib/pages/video/introduction/ugc/widgets/action_row_item.dart index 589cf4c2d..45dae1d19 100644 --- a/lib/pages/video/introduction/ugc/widgets/action_row_item.dart +++ b/lib/pages/video/introduction/ugc/widgets/action_row_item.dart @@ -26,8 +26,8 @@ class ActionRowItem extends StatelessWidget { final theme = Theme.of(context); return Material( color: selectStatus - ? theme.colorScheme.primaryContainer.withOpacity(0.6) - : theme.highlightColor.withOpacity(0.2), + ? theme.colorScheme.primaryContainer.withValues(alpha: 0.6) + : theme.highlightColor.withValues(alpha: 0.2), borderRadius: const BorderRadius.all(Radius.circular(30)), clipBehavior: Clip.hardEdge, child: InkWell( diff --git a/lib/pages/video/introduction/ugc/widgets/menu_row.dart b/lib/pages/video/introduction/ugc/widgets/menu_row.dart index bd730ed7f..2051ff4bd 100644 --- a/lib/pages/video/introduction/ugc/widgets/menu_row.dart +++ b/lib/pages/video/introduction/ugc/widgets/menu_row.dart @@ -55,7 +55,7 @@ class MenuRow extends StatelessWidget { {bool selectStatus = false}) { return Material( color: selectStatus - ? theme.highlightColor.withOpacity(0.2) + ? theme.highlightColor.withValues(alpha: 0.2) : Colors.transparent, borderRadius: const BorderRadius.all(Radius.circular(30)), clipBehavior: Clip.hardEdge, @@ -71,7 +71,7 @@ class MenuRow extends StatelessWidget { border: Border.all( color: selectStatus ? Colors.transparent - : theme.highlightColor.withOpacity(0.2), + : theme.highlightColor.withValues(alpha: 0.2), ), ), child: Row( diff --git a/lib/pages/video/medialist/view.dart b/lib/pages/video/medialist/view.dart index 65ca84d63..d7a9d5daf 100644 --- a/lib/pages/video/medialist/view.dart +++ b/lib/pages/video/medialist/view.dart @@ -112,7 +112,7 @@ class _MediaListPanelState ), Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), Expanded( child: enableSlide ? slideList(theme) : buildList(theme), diff --git a/lib/pages/video/note/view.dart b/lib/pages/video/note/view.dart index a6ebb5379..620e22006 100644 --- a/lib/pages/video/note/view.dart +++ b/lib/pages/video/note/view.dart @@ -70,7 +70,7 @@ class _NoteListPageState extends CommonSlidePageState { preferredSize: const Size.fromHeight(1), child: Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ), actions: [ @@ -101,7 +101,7 @@ class _NoteListPageState extends CommonSlidePageState { border: Border( top: BorderSide( width: 0.5, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ), ), @@ -165,7 +165,7 @@ class _NoteListPageState extends CommonSlidePageState { itemCount: response!.length, separatorBuilder: (context, index) => Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ), SliverToBoxAdapter( diff --git a/lib/pages/video/pay_coins/view.dart b/lib/pages/video/pay_coins/view.dart index 52b8709c6..6ec82c5e5 100644 --- a/lib/pages/video/pay_coins/view.dart +++ b/lib/pages/video/pay_coins/view.dart @@ -84,16 +84,16 @@ class _PayCoinsPageState extends State Color _getColorFilter(int index) { if (index == 1 && widget.hasCoin) { - return Colors.black.withOpacity(0.4); + return Colors.black.withValues(alpha: 0.4); } if (_coins == null) { return Colors.transparent; } if (index == 0 && _coins == 0) { - return Colors.black.withOpacity(0.4); + return Colors.black.withValues(alpha: 0.4); } if (index == 1 && _coins! < 2) { - return Colors.black.withOpacity(0.4); + return Colors.black.withValues(alpha: 0.4); } return Colors.transparent; } diff --git a/lib/pages/video/reply/widgets/reply_item_grpc.dart b/lib/pages/video/reply/widgets/reply_item_grpc.dart index f0ec22131..8477a6e4d 100644 --- a/lib/pages/video/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/reply/widgets/reply_item_grpc.dart @@ -161,7 +161,7 @@ class ReplyItemGrpc extends StatelessWidget { indent: 55, endIndent: 15, height: 0.3, - color: theme.colorScheme.outline.withOpacity(0.08), + color: theme.colorScheme.outline.withValues(alpha: 0.08), ) ], ); @@ -357,7 +357,7 @@ class ReplyItemGrpc extends StatelessWidget { Icon( Icons.reply, size: 18, - color: theme.colorScheme.outline.withOpacity(0.8), + color: theme.colorScheme.outline.withValues(alpha: 0.8), ), const SizedBox(width: 3), Text( @@ -479,8 +479,8 @@ class ReplyItemGrpc extends StatelessWidget { child: Text.rich( style: TextStyle( fontSize: theme.textTheme.bodyMedium!.fontSize, - color: - theme.colorScheme.onSurface.withOpacity(0.85), + color: theme.colorScheme.onSurface + .withValues(alpha: 0.85), height: 1.6), overflow: TextOverflow.ellipsis, maxLines: 2, @@ -553,8 +553,8 @@ class ReplyItemGrpc extends StatelessWidget { TextSpan( text: 'UP主等人 ', style: TextStyle( - color: - theme.colorScheme.onSurface.withOpacity(0.85), + color: theme.colorScheme.onSurface + .withValues(alpha: 0.85), ), ), TextSpan( diff --git a/lib/pages/video/reply_new/view.dart b/lib/pages/video/reply_new/view.dart index 300af8ead..e1fef1c4d 100644 --- a/lib/pages/video/reply_new/view.dart +++ b/lib/pages/video/reply_new/view.dart @@ -154,7 +154,7 @@ class _ReplyPageState extends CommonPublishPageState { ), Divider( height: 1, - color: themeData.dividerColor.withOpacity(0.1), + color: themeData.dividerColor.withValues(alpha: 0.1), ), Container( height: 52, diff --git a/lib/pages/video/reply_reply/view.dart b/lib/pages/video/reply_reply/view.dart index d3c42f684..376d20e4f 100644 --- a/lib/pages/video/reply_reply/view.dart +++ b/lib/pages/video/reply_reply/view.dart @@ -127,7 +127,7 @@ class _VideoReplyReplyPanelState border: Border( bottom: BorderSide( width: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), ), ), @@ -146,7 +146,7 @@ class _VideoReplyReplyPanelState ) : Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), Expanded( child: enableSlide ? slideList(theme) : buildList(theme), @@ -203,7 +203,7 @@ class _VideoReplyReplyPanelState } else if (index == 1) { return Divider( height: 20, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), thickness: 6, ); } else if (index == 2) { diff --git a/lib/pages/video/send_danmaku/view.dart b/lib/pages/video/send_danmaku/view.dart index ea6dfe48d..68fe28242 100644 --- a/lib/pages/video/send_danmaku/view.dart +++ b/lib/pages/video/send_danmaku/view.dart @@ -183,7 +183,7 @@ class _SendDanmakuPanelState extends CommonPublishPageState { decoration: BoxDecoration( border: Border( top: BorderSide( - color: themeData.colorScheme.outline.withOpacity(0.1), + color: themeData.colorScheme.outline.withValues(alpha: 0.1), ), ), ), diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index acafd66c9..b6826f301 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -556,8 +556,9 @@ class _VideoDetailPageVState extends State if (shouldShow) AppBar( backgroundColor: themeData.colorScheme.surface - .withOpacity( - videoDetailController.scrollRatio.value), + .withValues( + alpha: videoDetailController + .scrollRatio.value), toolbarHeight: 0, systemOverlayStyle: Platform.isAndroid ? SystemUiOverlayStyle( @@ -1543,7 +1544,7 @@ class _VideoDetailPageVState extends State border: Border( bottom: BorderSide( width: 1, - color: themeData.dividerColor.withOpacity(0.1), + color: themeData.dividerColor.withValues(alpha: 0.1), ), ), ), @@ -1748,7 +1749,7 @@ class _VideoDetailPageVState extends State ), backgroundColor: themeData .colorScheme.secondaryContainer - .withOpacity(0.8), + .withValues(alpha: 0.8), padding: const EdgeInsets.symmetric( horizontal: 15, vertical: 10, @@ -1818,7 +1819,8 @@ class _VideoDetailPageVState extends State height: 1, indent: 12, endIndent: 12, - color: themeData.colorScheme.outline.withOpacity(0.08), + color: themeData.colorScheme.outline + .withValues(alpha: 0.08), ), ), ), @@ -1873,7 +1875,7 @@ class _VideoDetailPageVState extends State padding: const EdgeInsets.symmetric(horizontal: 16), decoration: BoxDecoration( color: themeData.colorScheme.secondaryContainer - .withOpacity(0.95), + .withValues(alpha: 0.95), borderRadius: const BorderRadius.all(Radius.circular(14)), ), child: Row( @@ -1953,7 +1955,7 @@ class _VideoDetailPageVState extends State const SizedBox(height: 8), Divider( height: 1, - color: themeData.colorScheme.outline.withOpacity(0.1), + color: themeData.colorScheme.outline.withValues(alpha: 0.1), ), ], Padding( diff --git a/lib/pages/video/view_point/view.dart b/lib/pages/video/view_point/view.dart index a368b1224..2534b1e39 100644 --- a/lib/pages/video/view_point/view.dart +++ b/lib/pages/video/view_point/view.dart @@ -78,7 +78,7 @@ class _ViewPointsPageState preferredSize: const Size.fromHeight(1), child: Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), ), ), @@ -160,7 +160,7 @@ class _ViewPointsPageState }, separatorBuilder: (context, index) => Divider( height: 1, - color: theme.dividerColor.withOpacity(0.1), + color: theme.dividerColor.withValues(alpha: 0.1), ), ); } diff --git a/lib/pages/whisper/view.dart b/lib/pages/whisper/view.dart index 41c8d5068..a9def3f95 100644 --- a/lib/pages/whisper/view.dart +++ b/lib/pages/whisper/view.dart @@ -117,7 +117,7 @@ class _WhisperPageState extends State { indent: 72, endIndent: 20, height: 1, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ), ) : HttpError( diff --git a/lib/pages/whisper/widgets/item.dart b/lib/pages/whisper/widgets/item.dart index 10e5c48c5..b2edb59a8 100644 --- a/lib/pages/whisper/widgets/item.dart +++ b/lib/pages/whisper/widgets/item.dart @@ -36,7 +36,7 @@ class WhisperSessionItem extends StatelessWidget { return ListTile( tileColor: item.isPinned ? theme.colorScheme.onInverseSurface - .withOpacity(Get.isDarkMode ? 0.4 : 0.8) + .withValues(alpha: Get.isDarkMode ? 0.4 : 0.8) : null, onLongPress: () { showDialog( diff --git a/lib/pages/whisper_detail/view.dart b/lib/pages/whisper_detail/view.dart index 190281ab9..bceb59bd2 100644 --- a/lib/pages/whisper_detail/view.dart +++ b/lib/pages/whisper_detail/view.dart @@ -106,7 +106,7 @@ class _WhisperDetailPageState icon: Icon( size: 20, Icons.settings, - color: theme.colorScheme.onSurfaceVariant.withOpacity(0.8), + color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.8), ), ), const SizedBox(width: 10), diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index af8fcd8a9..f667c827b 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -107,9 +107,9 @@ class ChatItem extends StatelessWidget { style: theme.textTheme.labelSmall!.copyWith( color: isOwner ? theme.colorScheme.onSecondaryContainer - .withOpacity(0.8) + .withValues(alpha: 0.8) : theme.colorScheme.onSurfaceVariant - .withOpacity(0.8)), + .withValues(alpha: 0.8)), ), if (item.msgStatus == 1) Text( @@ -196,7 +196,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, ), ), @@ -247,7 +247,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, overflow: TextOverflow.ellipsis, ), @@ -335,7 +335,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, ), ), @@ -344,7 +344,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, ), ), @@ -407,7 +407,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, ), ), @@ -530,7 +530,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( letterSpacing: 0.6, height: 1.5, - color: textColor.withOpacity(0.6), + color: textColor.withValues(alpha: 0.6), fontSize: 12, ), ), @@ -564,7 +564,7 @@ class ChatItem extends StatelessWidget { style: TextStyle( height: 1.5, letterSpacing: 0.6, - color: theme.colorScheme.outline.withOpacity(0.8), + color: theme.colorScheme.outline.withValues(alpha: 0.8), ), ), ); @@ -642,7 +642,7 @@ class ChatItem extends StatelessWidget { style: theme.textTheme.labelSmall! .copyWith(color: theme.colorScheme.outline), ), - Divider(color: theme.colorScheme.primary.withOpacity(0.05)), + Divider(color: theme.colorScheme.primary.withValues(alpha: 0.05)), SelectableText(content['text']), if (modules?.isNotEmpty == true) ...[ const SizedBox(height: 4), @@ -664,7 +664,7 @@ class ChatItem extends StatelessWidget { ], if ((content['jump_text'] as String?)?.isNotEmpty == true && (content['jump_uri'] as String?)?.isNotEmpty == true) ...[ - Divider(color: theme.colorScheme.primary.withOpacity(0.05)), + Divider(color: theme.colorScheme.primary.withValues(alpha: 0.05)), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -678,7 +678,7 @@ class ChatItem extends StatelessWidget { ], if ((content['jump_text_2'] as String?)?.isNotEmpty == true && (content['jump_uri_2'] as String?)?.isNotEmpty == true) ...[ - Divider(color: theme.colorScheme.primary.withOpacity(0.05)), + Divider(color: theme.colorScheme.primary.withValues(alpha: 0.05)), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -692,7 +692,7 @@ class ChatItem extends StatelessWidget { ], if ((content['jump_text_3'] as String?)?.isNotEmpty == true && (content['jump_uri_3'] as String?)?.isNotEmpty == true) ...[ - Divider(color: theme.colorScheme.primary.withOpacity(0.05)), + Divider(color: theme.colorScheme.primary.withValues(alpha: 0.05)), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { diff --git a/lib/pages/whisper_link_setting/view.dart b/lib/pages/whisper_link_setting/view.dart index 72fba19e1..8e3d2b639 100644 --- a/lib/pages/whisper_link_setting/view.dart +++ b/lib/pages/whisper_link_setting/view.dart @@ -33,12 +33,12 @@ class _WhisperLinkSettingPageState extends State { final divider = Divider( height: 12, thickness: 12, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ); final divider2 = Divider( height: 1, indent: 16, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ); return Scaffold( appBar: AppBar(title: const Text('聊天设置')), diff --git a/lib/pages/whisper_secondary/view.dart b/lib/pages/whisper_secondary/view.dart index bdc608f10..c6ffe4f79 100644 --- a/lib/pages/whisper_secondary/view.dart +++ b/lib/pages/whisper_secondary/view.dart @@ -106,7 +106,7 @@ class _WhisperSecPageState extends State { indent: 72, endIndent: 20, height: 1, - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), ), ) : HttpError( diff --git a/lib/pages/whisper_settings/view.dart b/lib/pages/whisper_settings/view.dart index 18e75d8d3..6821ef382 100644 --- a/lib/pages/whisper_settings/view.dart +++ b/lib/pages/whisper_settings/view.dart @@ -174,7 +174,7 @@ class _WhisperSettingsPageState extends State { }, separatorBuilder: (context, index) => Divider( height: 1, - color: theme.colorScheme.outline.withOpacity(0.1), + color: theme.colorScheme.outline.withValues(alpha: 0.1), ), ); }), diff --git a/lib/pages/whisper_settings/widgets/item.dart b/lib/pages/whisper_settings/widgets/item.dart index f35c2115e..84b2d7843 100644 --- a/lib/pages/whisper_settings/widgets/item.dart +++ b/lib/pages/whisper_settings/widgets/item.dart @@ -125,7 +125,7 @@ class ImSettingsItem extends StatelessWidget { late final divider = Divider( height: 1, indent: 16, - color: outline.withOpacity(0.1), + color: outline.withValues(alpha: 0.1), ); return Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 156a7ab20..3b965f797 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -328,7 +328,7 @@ class PlPlayerController { fontWeight: FontWeight.values[subtitleFontWeight], backgroundColor: subtitleBgOpaticy == 0 ? null - : Colors.black.withOpacity(subtitleBgOpaticy), + : Colors.black.withValues(alpha: subtitleBgOpaticy), ); SubtitleViewConfiguration get subtitleViewConfiguration => diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 2e0ff7d34..58f26d130 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -411,7 +411,7 @@ class _PLVideoPlayerState extends State child: PopupMenuButton( initialValue: SuperResolutionType .values[plPlayerController.superResolutionType], - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return SuperResolutionType.values .map((SuperResolutionType type) { @@ -532,7 +532,7 @@ class _PLVideoPlayerState extends State alignment: Alignment.center, child: PopupMenuButton( initialValue: plPlayerController.videoFit.value, - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return BoxFit.values.map((BoxFit boxFit) { return PopupMenuItem( @@ -567,7 +567,7 @@ class _PLVideoPlayerState extends State initialValue: widget .videoDetailController!.vttSubtitlesIndex.value .clamp(0, widget.videoDetailController!.subtitles.length), - color: Colors.black.withOpacity(0.8), + color: Colors.black.withValues(alpha: 0.8), itemBuilder: (BuildContext context) { return [ PopupMenuItem( @@ -623,7 +623,7 @@ class _PLVideoPlayerState extends State alignment: Alignment.center, child: PopupMenuButton( 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( @@ -1328,7 +1328,7 @@ class _PLVideoPlayerState extends State style: FilledButton.styleFrom( tapTargetSize: MaterialTapTargetSize.shrinkWrap, backgroundColor: theme.colorScheme.secondaryContainer - .withOpacity(0.8), + .withValues(alpha: 0.8), visualDensity: VisualDensity.compact, padding: const EdgeInsets.all(15), shape: const RoundedRectangleBorder( @@ -1418,8 +1418,8 @@ class _PLVideoPlayerState extends State buffered: Duration(seconds: buffer), total: Duration(seconds: max), progressBarColor: primary, - baseBarColor: Colors.white.withOpacity(0.2), - bufferedBarColor: primary.withOpacity(0.4), + baseBarColor: Colors.white.withValues(alpha: 0.2), + bufferedBarColor: primary.withValues(alpha: 0.4), timeLabelLocation: TimeLabelLocation.none, thumbColor: primary, barHeight: 3.5, @@ -1794,7 +1794,7 @@ Widget buildDmChart( dotData: const FlDotData(show: false), belowBarData: BarAreaData( show: true, - color: color.withOpacity(0.4), + color: color.withValues(alpha: 0.4), ), ), ], diff --git a/lib/plugin/pl_player/widgets/bottom_control.dart b/lib/plugin/pl_player/widgets/bottom_control.dart index 02997f3e0..36622edba 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -9,7 +9,6 @@ import 'package:PiliPlus/utils/feed_back.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:get/get.dart'; -import 'package:nil/nil.dart'; class BottomControl extends StatelessWidget implements PreferredSizeWidget { final PlPlayerController controller; @@ -41,7 +40,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { final int max = controller.durationSeconds.value.inSeconds; final int buffer = controller.bufferedSeconds.value; if (value > max || max <= 0) { - return nil; + return const SizedBox.shrink(); } return Padding( padding: const EdgeInsets.only(left: 10, right: 10, bottom: 7), @@ -62,8 +61,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, diff --git a/lib/utils/login_utils.dart b/lib/utils/login_utils.dart index 65871ce39..2781a7276 100644 --- a/lib/utils/login_utils.dart +++ b/lib/utils/login_utils.dart @@ -20,7 +20,6 @@ import 'package:PiliPlus/utils/storage.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart' as web; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; -import 'package:webview_cookie_manager/webview_cookie_manager.dart'; class LoginUtils { static final random = Random(); @@ -32,7 +31,6 @@ class LoginUtils { final cookies = account.cookieJar.toList(); final webManager = web.CookieManager(); Future.wait([ - WebviewCookieManager().setCookies(cookies), ...cookies.map((item) => webManager.setCookie( url: web.WebUri(item.domain ?? ''), name: item.name, diff --git a/lib/utils/theme_utils.dart b/lib/utils/theme_utils.dart index ab6aa38b7..482127c73 100644 --- a/lib/utils/theme_utils.dart +++ b/lib/utils/theme_utils.dart @@ -90,6 +90,7 @@ class ThemeUtils { color: colorScheme.onSurface, fontWeight: fontWeight, ), + backgroundColor: colorScheme.surface, ), bottomSheetTheme: BottomSheetThemeData( backgroundColor: colorScheme.surface, diff --git a/pubspec.lock b/pubspec.lock index 8860532d0..f8565fb55 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" animations: dependency: "direct main" description: @@ -74,10 +74,10 @@ packages: dependency: "direct main" description: name: archive - sha256: "7dcbd0f87fe5f61cb28da39a1a8b70dbc106e2fe0516f7836eb7bb2948481a12" + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" url: "https://pub.dev" source: hosted - version: "4.0.5" + version: "4.0.7" args: dependency: transitive description: @@ -90,26 +90,26 @@ packages: dependency: transitive description: name: asn1lib - sha256: "4bae5ae63e6d6dd17c4aac8086f3dec26c0236f6a0f03416c6c19d830c367cf5" + sha256: "0511d6be23b007e95105ae023db599aea731df604608978dada7f9faf2637623" url: "https://pub.dev" source: hosted - version: "1.5.8" + version: "1.6.4" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" audio_service: dependency: "direct main" description: name: audio_service - sha256: "887ddf15fce31fd12aa8044c3bffd14c58929fb20e31d96284fe3aaf48315ac6" + sha256: cb122c7c2639d2a992421ef96b67948ad88c5221da3365ccef1031393a76e044 url: "https://pub.dev" source: hosted - version: "0.18.17" + version: "0.18.18" audio_service_platform_interface: dependency: transitive description: @@ -147,10 +147,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" brotli: dependency: "direct main" description: @@ -163,50 +163,50 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.4" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.4" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" url: "https://pub.dev" source: hosted - version: "2.4.13" + version: "2.4.15" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" url: "https://pub.dev" source: hosted - version: "7.3.2" + version: "8.0.0" built_collection: dependency: transitive description: @@ -268,18 +268,18 @@ packages: dependency: "direct main" description: name: catcher_2 - sha256: a09094ff8cd18506af0bea98d790b340ad6ac62fe3b9b37f9658b96ccb700053 + sha256: ffdad9d314a91d2baabd90b3332bccda00b5f2fabd9d6afa4f988479b9bc3eca url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.3" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" chat_bottom_container: dependency: "direct main" description: @@ -309,10 +309,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -325,18 +325,18 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: "04bf81bb0b77de31557b58d052b24b3eee33f09a6e7a8c68a3e247c7df19ec27" + sha256: "051849e2bd7c7b3bc5844ea0d096609ddc3a859890ec3a9ac4a65a2620cc1f99" url: "https://pub.dev" source: hosted - version: "6.1.3" + version: "6.1.4" connectivity_plus_platform_interface: dependency: transitive description: @@ -381,10 +381,10 @@ packages: dependency: transitive description: name: csslib - sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "0.17.3" + version: "1.0.2" cupertino_icons: dependency: "direct main" description: @@ -397,10 +397,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" url: "https://pub.dev" source: hosted - version: "2.3.7" + version: "2.3.8" dbus: dependency: transitive description: @@ -413,10 +413,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "72d146c6d7098689ff5c5f66bcf593ac11efc530095385356e131070333e64da" + sha256: "0c6396126421b590089447154c5f98a5de423b70cfb15b1578fd018843ee6f53" url: "https://pub.dev" source: hosted - version: "11.3.0" + version: "11.4.0" device_info_plus_platform_interface: dependency: transitive description: @@ -526,18 +526,18 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" ffi: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" file: dependency: transitive description: @@ -598,16 +598,16 @@ packages: dependency: "direct main" description: name: flex_seed_scheme - sha256: "7639d2c86268eff84a909026eb169f008064af0fb3696a651b24b0fa24a40334" + sha256: b06d8b367b84cbf7ca5c5603c858fa5edae88486c4e4da79ac1044d73b6c62ec url: "https://pub.dev" source: hosted - version: "3.4.1" + version: "3.5.1" floating: dependency: "direct main" description: path: "." ref: version-3 - resolved-ref: "202a46c31bc2c101b254f559115e47661cdb2479" + resolved-ref: "44bd7a589f199e0b8f7f5bb1a6df08579079c570" url: "https://github.com/bggRGjQaUbCoE/floating.git" source: git version: "3.0.0" @@ -636,10 +636,10 @@ packages: dependency: "direct main" description: name: flutter_html - sha256: "02ad69e813ecfc0728a455e4bf892b9379983e050722b1dce00192ee2e41d1ee" + sha256: "38a2fd702ffdf3243fb7441ab58aa1bc7e6922d95a50db76534de8260638558d" url: "https://pub.dev" source: hosted - version: "3.0.0-beta.2" + version: "3.0.0" flutter_inappwebview: dependency: "direct main" description: @@ -737,18 +737,18 @@ packages: dependency: "direct dev" description: name: flutter_native_splash - sha256: "7062602e0dbd29141fb8eb19220b5871ca650be5197ab9c1f193a28b17537bc7" + sha256: "8321a6d11a8d13977fa780c89de8d257cce3d841eecfb7a4cadffcc4f12d82dc" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.6" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "1c2b787f99bdca1f3718543f81d38aa1b124817dfeb9fb196201bea85b6134bf" + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e url: "https://pub.dev" source: hosted - version: "2.0.26" + version: "2.0.28" flutter_smart_dialog: dependency: "direct main" description: @@ -770,10 +770,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1 url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.1.0" flutter_test: dependency: "direct dev" description: flutter @@ -884,18 +884,18 @@ packages: dependency: "direct main" description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.6" http: dependency: transitive description: name: http - sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" http2: dependency: transitive description: @@ -916,10 +916,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" image: dependency: transitive description: @@ -932,26 +932,26 @@ packages: dependency: "direct main" description: name: image_cropper - sha256: fe37d9a129411486e0d93089b61bd326d05b89e78ad4981de54b560725bf5bd5 + sha256: "266760ed426d7121f0ada02c672bfe5c1b5c714e908328716aee756f045709dc" url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "8.1.0" image_cropper_for_web: dependency: transitive description: name: image_cropper_for_web - sha256: "34256c8fb7fcb233251787c876bb37271744459b593a948a2db73caa323034d0" + sha256: fd81ebe36f636576094377aab32673c4e5d1609b32dec16fad98d2b71f1250a9 url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" image_cropper_platform_interface: dependency: transitive description: name: image_cropper_platform_interface - sha256: e8e9d2ca36360387aee39295ce49029362ae4df3071f23e8e71f2b81e40b7531 + sha256: "6ca6b81769abff9a4dcc3bbd3d75f5dfa9de6b870ae9613c8cd237333a4283af" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.1.0" image_picker: dependency: "direct main" description: @@ -964,10 +964,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "82652a75e3dd667a91187769a6a2cc81bd8c111bbead698d8e938d2b63e5e89a" + sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb" url: "https://pub.dev" source: hosted - version: "0.8.12+21" + version: "0.8.12+23" image_picker_for_web: dependency: transitive description: @@ -1052,18 +1052,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.8" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -1076,10 +1076,10 @@ packages: dependency: transitive description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.1" list_counter: dependency: transitive description: @@ -1116,10 +1116,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" mailer: dependency: transitive description: @@ -1140,10 +1140,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -1237,10 +1237,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" mime: dependency: "direct main" description: @@ -1249,14 +1249,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" - nil: - dependency: "direct main" - description: - name: nil - sha256: ef05770c48942876d843bf6a4822d35e5da0ff893a61f1d5ad96d15c4a659136 - url: "https://pub.dev" - source: hosted - version: "1.1.1" nm: dependency: transitive description: @@ -1325,10 +1317,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" + sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 url: "https://pub.dev" source: hosted - version: "2.2.15" + version: "2.2.17" path_provider_foundation: dependency: transitive description: @@ -1381,10 +1373,10 @@ packages: dependency: transitive description: name: permission_handler_apple - sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98 + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 url: "https://pub.dev" source: hosted - version: "9.4.6" + version: "9.4.7" permission_handler_html: dependency: transitive description: @@ -1413,10 +1405,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: @@ -1453,18 +1445,18 @@ packages: dependency: transitive description: name: posix - sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62 url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "6.0.2" pretty_qr_code: dependency: "direct main" description: name: pretty_qr_code - sha256: cbdb4af29da1c1fa21dd76f809646c591320ab9e435d3b0eab867492d43607d5 + sha256: b078bd5d51956dea4342378af1b092ad962b81bdbb55b10fffce03461da8db74 url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.0" protobuf: dependency: "direct main" description: @@ -1485,10 +1477,10 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.0" qr: dependency: transitive description: @@ -1533,10 +1525,10 @@ packages: dependency: "direct main" description: name: screen_brightness - sha256: eca7bd9d2c3c688bcad14855361cab7097839400b6b4a56f62b7ae511c709958 + sha256: "46d1b448729c1ed67c812f2c97d7fa8308809d91031c7ecdeb216ca65f7660de" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" screen_brightness_android: dependency: transitive description: @@ -1561,6 +1553,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + screen_brightness_ohos: + dependency: transitive + description: + name: screen_brightness_ohos + sha256: "61e313e46eaee3f83dd4e85a2a91f8a81be02c154bc9e60830a7c0fd76dac286" + url: "https://pub.dev" + source: hosted + version: "2.1.0" screen_brightness_platform_interface: dependency: transitive description: @@ -1589,10 +1589,10 @@ packages: dependency: transitive description: name: sentry - sha256: "077b03f9ee44cfb1eaadbf8af58255e670de62b3f240ca154ce96a5591dc3885" + sha256: "599701ca0693a74da361bc780b0752e1abc98226cf5095f6b069648116c896bb" url: "https://pub.dev" source: hosted - version: "8.14.1" + version: "8.14.2" share_plus: dependency: "direct main" description: @@ -1614,18 +1614,18 @@ packages: dependency: transitive description: name: shared_preferences - sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.3" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "9f9f3d372d4304723e6136663bb291c0b93f5e4c8a4a6314347f481a33bda2b1" + sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" url: "https://pub.dev" source: hosted - version: "2.4.7" + version: "2.4.10" shared_preferences_foundation: dependency: transitive description: @@ -1670,23 +1670,23 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1707,10 +1707,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" sprintf: dependency: transitive description: @@ -1723,34 +1723,34 @@ packages: dependency: transitive description: name: sqflite - sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" + sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" sqflite_android: dependency: transitive description: name: sqflite_android - sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" + sha256: "84731e8bfd8303a3389903e01fb2141b6e59b5973cacbb0929021df08dddbe8b" url: "https://pub.dev" source: hosted - version: "2.5.4+6" + version: "2.5.5" sqflite_darwin: dependency: transitive description: name: sqflite_darwin - sha256: "22adfd9a2c7d634041e96d6241e6e1c8138ca6817018afc5d443fef91dcefa9c" + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" url: "https://pub.dev" source: hosted - version: "2.4.1+1" + version: "2.4.2" sqflite_platform_interface: dependency: transitive description: @@ -1763,18 +1763,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" stream_transform: dependency: "direct main" description: @@ -1787,18 +1787,18 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" synchronized: dependency: "direct main" description: name: synchronized - sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" + sha256: "0669c70faae6270521ee4f05bffd2919892d42d1276e6c495be80174b6bc0ef6" url: "https://pub.dev" source: hosted - version: "3.3.0+3" + version: "3.3.1" system_proxy: dependency: "direct main" description: @@ -1811,18 +1811,18 @@ packages: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.4" timing: dependency: transitive description: @@ -1875,18 +1875,18 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" + sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79" url: "https://pub.dev" source: hosted - version: "6.3.14" + version: "6.3.16" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.3.3" url_launcher_linux: dependency: transitive description: @@ -1915,10 +1915,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.1" url_launcher_windows: dependency: transitive description: @@ -1979,10 +1979,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.1" volume_controller: dependency: transitive description: @@ -1995,18 +1995,18 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: "36c88af0b930121941345306d259ec4cc4ecca3b151c02e3a9e71aede83c615e" + sha256: a474e314c3e8fb5adef1f9ae2d247e57467ad557fa7483a2b895bc1b421c5678 url: "https://pub.dev" source: hosted - version: "1.2.10" + version: "1.3.2" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" + sha256: e10444072e50dbc4999d7316fd303f7ea53d31c824aa5eb05d7ccbdd98985207 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.3" watcher: dependency: transitive description: @@ -2035,18 +2035,18 @@ packages: dependency: transitive description: name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" webdav_client: dependency: "direct main" description: @@ -2055,30 +2055,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.2" - webview_cookie_manager: - dependency: "direct main" - description: - name: webview_cookie_manager - sha256: "425a9feac5cd2cb62a71da3dda5ac2eaf9ece5481ee8d79f3868dc5ba8223ad3" - url: "https://pub.dev" - source: hosted - version: "2.0.6" win32: dependency: transitive description: name: win32 - sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" url: "https://pub.dev" source: hosted - version: "5.10.1" + version: "5.13.0" win32_registry: dependency: transitive description: name: win32_registry - sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "2.1.0" xdg_directories: dependency: transitive description: @@ -2104,5 +2096,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.5" + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.29.3" diff --git a/pubspec.yaml b/pubspec.yaml index 215152a85..b62b92f8f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ version: 1.1.3+1 environment: sdk: ">=3.0.0 <4.0.0" - flutter: 3.24.5 + flutter: 3.29.3 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -74,7 +74,7 @@ dependencies: ref: main path: packages/share_plus/share_plus # cookie 管理 - webview_cookie_manager: ^2.0.6 + # webview_cookie_manager: ^2.0.6 # 浏览器 # webview_flutter: ^4.10.0 flutter_inappwebview: ^6.1.5 @@ -161,7 +161,7 @@ dependencies: gt3_flutter_plugin: ^0.1.0 uuid: ^4.5.1 scrollable_positioned_list: ^0.3.8 - nil: ^1.1.1 + # nil: ^1.1.1 catcher_2: ^2.1.0 logger: ^2.5.0 #瀑布流