diff --git a/lib/pages/common/dyn/common_dyn_page.dart b/lib/pages/common/dyn/common_dyn_page.dart index cfec13a79..42c1a05be 100644 --- a/lib/pages/common/dyn/common_dyn_page.dart +++ b/lib/pages/common/dyn/common_dyn_page.dart @@ -92,7 +92,7 @@ mixin CommonDynPageMixin child: Padding( padding: const .fromLTRB(12, 2.5, 6, 2.5), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: .spaceBetween, children: [ Obx( () { diff --git a/lib/pages/main_reply/view.dart b/lib/pages/main_reply/view.dart index 124216978..c46a04ef7 100644 --- a/lib/pages/main_reply/view.dart +++ b/lib/pages/main_reply/view.dart @@ -183,7 +183,7 @@ class _MainReplyPageState extends State child: Padding( padding: const .fromLTRB(12, 2.5, 6, 2.5), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: .spaceBetween, children: [ Obx( () { diff --git a/lib/pages/pgc_review/child/view.dart b/lib/pages/pgc_review/child/view.dart index 70d5f7173..36363ff86 100644 --- a/lib/pages/pgc_review/child/view.dart +++ b/lib/pages/pgc_review/child/view.dart @@ -377,7 +377,7 @@ class _PgcReviewChildPageState extends State child: Padding( padding: const EdgeInsets.fromLTRB(12, 2.5, 6, 2.5), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: .spaceBetween, children: [ Obx( () { diff --git a/lib/pages/video/note/view.dart b/lib/pages/video/note/view.dart index ca8bdab95..444265542 100644 --- a/lib/pages/video/note/view.dart +++ b/lib/pages/video/note/view.dart @@ -123,7 +123,7 @@ class _NoteListPageState extends State ); if (_isNested) { child = ExtendedVisibilityDetector( - uniqueKey: const Key('note-list'), + uniqueKey: const ValueKey(NoteListPage), child: child, ); } diff --git a/lib/pages/video/post_panel/view.dart b/lib/pages/video/post_panel/view.dart index 71417dcf0..2380ba5b0 100644 --- a/lib/pages/video/post_panel/view.dart +++ b/lib/pages/video/post_panel/view.dart @@ -262,7 +262,7 @@ class _PostPanelState extends State ); if (_isNested) { child = ExtendedVisibilityDetector( - uniqueKey: const Key('post-panel'), + uniqueKey: const ValueKey(PostPanel), child: child, ); } diff --git a/lib/pages/video/reply/view.dart b/lib/pages/video/reply/view.dart index 72e3e4510..a5ed1f6b3 100644 --- a/lib/pages/video/reply/view.dart +++ b/lib/pages/video/reply/view.dart @@ -38,6 +38,7 @@ class _VideoReplyPanelState extends State SingleTickerProviderStateMixin, BaseFabMixin, FabMixin { + late ColorScheme colorScheme; late VideoReplyController _videoReplyController; String get heroTag => widget.heroTag; @@ -57,6 +58,7 @@ class _VideoReplyPanelState extends State @override void didChangeDependencies() { super.didChangeDependencies(); + colorScheme = ColorScheme.of(context); bottom = MediaQuery.viewPaddingOf(context).bottom; } @@ -65,7 +67,6 @@ class _VideoReplyPanelState extends State @override Widget build(BuildContext context) { super.build(context); - final theme = Theme.of(context); final child = NotificationListener( onNotification: (notification) { switch (notification.direction) { @@ -81,7 +82,7 @@ class _VideoReplyPanelState extends State onRefresh: _videoReplyController.onRefresh, isClampingScrollPhysics: widget.isNested, child: Stack( - clipBehavior: Clip.none, + clipBehavior: .none, children: [ CustomScrollView( controller: widget.isNested @@ -91,45 +92,41 @@ class _VideoReplyPanelState extends State key: const PageStorageKey(_VideoReplyPanelState), slivers: [ SliverFloatingHeaderWidget( - backgroundColor: theme.colorScheme.surface, + backgroundColor: colorScheme.surface, child: Padding( padding: const .fromLTRB(12, 2.5, 6, 2.5), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Obx( - () => Text( - _videoReplyController.sortType.value.title, + child: Obx(() { + final sortType = _videoReplyController.sortType.value; + return Row( + mainAxisAlignment: .spaceBetween, + children: [ + Text( + sortType.title, style: const TextStyle(fontSize: 13), ), - ), - TextButton.icon( - style: Style.buttonStyle, - onPressed: _videoReplyController.queryBySort, - icon: Icon( - Icons.sort, - size: 16, - color: theme.colorScheme.secondary, - ), - label: Obx( - () => Text( - _videoReplyController.sortType.value.label, + TextButton.icon( + style: Style.buttonStyle, + onPressed: _videoReplyController.queryBySort, + icon: Icon( + Icons.sort, + size: 16, + color: colorScheme.secondary, + ), + label: Text( + sortType.label, style: TextStyle( fontSize: 13, - color: theme.colorScheme.secondary, + color: colorScheme.secondary, ), ), ), - ), - ], - ), + ], + ); + }), ), ), Obx( - () => _buildBody( - theme, - _videoReplyController.loadingState.value, - ), + () => _buildBody(_videoReplyController.loadingState.value), ), ], ), @@ -165,17 +162,14 @@ class _VideoReplyPanelState extends State ); if (widget.isNested) { return ExtendedVisibilityDetector( - uniqueKey: const Key('reply-list'), + uniqueKey: const ValueKey(VideoReplyPanel), child: child, ); } return child; } - Widget _buildBody( - ThemeData theme, - LoadingState?> loadingState, - ) { + Widget _buildBody(LoadingState?> loadingState) { return switch (loadingState) { Loading() => SliverList.builder( itemBuilder: (context, index) => const VideoReplySkeleton(), @@ -189,14 +183,14 @@ class _VideoReplyPanelState extends State _videoReplyController.onLoadMore(); return Container( height: 125, - alignment: Alignment.center, - margin: EdgeInsets.only(bottom: bottom), + alignment: .center, + margin: .only(bottom: bottom), child: Text( _videoReplyController.isEnd ? '没有更多了' : '加载中...', - textAlign: TextAlign.center, + textAlign: .center, style: TextStyle( fontSize: 12, - color: theme.colorScheme.outline, + color: colorScheme.outline, ), ), ); diff --git a/lib/pages/video/reply_reply/view.dart b/lib/pages/video/reply_reply/view.dart index ed7e3d910..31db3f28c 100644 --- a/lib/pages/video/reply_reply/view.dart +++ b/lib/pages/video/reply_reply/view.dart @@ -246,9 +246,9 @@ class _VideoReplyReplyPanelState extends State return SliverPinnedHeader( backgroundColor: colorScheme.surface, child: Padding( - padding: const EdgeInsets.fromLTRB(12, 2.5, 6, 2.5), + padding: const .fromLTRB(12, 2.5, 6, 2.5), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: .spaceBetween, children: [ Obx( () { diff --git a/lib/pages/video/view_point/view.dart b/lib/pages/video/view_point/view.dart index c33d2cafd..9acc3f532 100644 --- a/lib/pages/video/view_point/view.dart +++ b/lib/pages/video/view_point/view.dart @@ -115,7 +115,7 @@ class _ViewPointsPageState extends State ); if (_isNested) { return ExtendedVisibilityDetector( - uniqueKey: const Key('viewpoints'), + uniqueKey: const ValueKey(ViewPointsPage), child: child, ); }