diff --git a/lib/pages/article/view.dart b/lib/pages/article/view.dart index e843b9bb..9a3f1efa 100644 --- a/lib/pages/article/view.dart +++ b/lib/pages/article/view.dart @@ -179,7 +179,6 @@ class _ArticlePageState extends State VoidCallback? onDispose, }) => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), titleSpacing: automaticallyImplyLeading ? null : 12, diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index 0f9f4b50..d843aaec 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -130,7 +130,6 @@ class _DynamicsPageState extends State super.build(context); ThemeData theme = Theme.of(context); return Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( leading: upPanelPosition == UpPanelPosition.rightDrawer ? _createDynamicBtn(theme, false) diff --git a/lib/pages/dynamics_create/view.dart b/lib/pages/dynamics_create/view.dart index 63588acb..64bc08b7 100644 --- a/lib/pages/dynamics_create/view.dart +++ b/lib/pages/dynamics_create/view.dart @@ -57,152 +57,146 @@ class _CreateDynPanelState extends CommonPublishPageState { @override Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); - return Scaffold( - backgroundColor: Colors.transparent, - resizeToAvoidBottomInset: false, - appBar: _buildAppBar(theme), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.zero, - controller: widget.scrollController, - physics: const ClampingScrollPhysics(), - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Obx( - () { - final hasTopic = topic.value != null; - return Row( - spacing: 10, - children: [ - TextButton( - style: TextButton.styleFrom( - overlayColor: - hasTopic ? Colors.transparent : null, - splashFactory: - hasTopic ? NoSplash.splashFactory : null, - shape: hasTopic - ? null - : RoundedRectangleBorder( - side: BorderSide( - color: hasTopic - ? Colors.transparent - : theme.colorScheme.outline - .withValues(alpha: 0.2), - ), - borderRadius: const BorderRadius.all( - Radius.circular(25), - ), + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildAppBar(theme), + Expanded( + child: ListView( + padding: EdgeInsets.zero, + controller: widget.scrollController, + physics: const ClampingScrollPhysics(), + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Obx( + () { + final hasTopic = topic.value != null; + return Row( + spacing: 10, + children: [ + TextButton( + style: TextButton.styleFrom( + overlayColor: hasTopic ? Colors.transparent : null, + splashFactory: + hasTopic ? NoSplash.splashFactory : null, + shape: hasTopic + ? null + : RoundedRectangleBorder( + side: BorderSide( + color: hasTopic + ? Colors.transparent + : theme.colorScheme.outline + .withValues(alpha: 0.2), ), - minimumSize: Size.zero, - padding: hasTopic - ? const EdgeInsets.symmetric(vertical: 12) - : const EdgeInsets.all(12), - visualDensity: VisualDensity.compact, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - ), - onPressed: _onSelectTopic, - child: Text.rich( - TextSpan( - children: [ - WidgetSpan( - child: Padding( - padding: const EdgeInsets.only(right: 5), - child: Icon( - CustomIcon.topic_tag, - size: 18, - color: hasTopic - ? null - : theme.colorScheme.outline, - ), + borderRadius: const BorderRadius.all( + Radius.circular(25), ), ), - TextSpan( - text: - hasTopic ? topic.value!.second : '选择话题', - style: TextStyle( + minimumSize: Size.zero, + padding: hasTopic + ? const EdgeInsets.symmetric(vertical: 12) + : const EdgeInsets.all(12), + visualDensity: VisualDensity.compact, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + onPressed: _onSelectTopic, + child: Text.rich( + TextSpan( + children: [ + WidgetSpan( + child: Padding( + padding: const EdgeInsets.only(right: 5), + child: Icon( + CustomIcon.topic_tag, + size: 18, color: hasTopic ? null : theme.colorScheme.outline, ), ), - ], - ), + ), + TextSpan( + text: hasTopic ? topic.value!.second : '选择话题', + style: TextStyle( + color: hasTopic + ? null + : theme.colorScheme.outline, + ), + ), + ], ), ), - if (hasTopic) - iconButton( - size: 22, - iconSize: 16, - context: context, - icon: Icons.clear, - bgColor: theme.colorScheme.onInverseSurface, - iconColor: theme.colorScheme.onSurfaceVariant, - onPressed: () => topic.value = null, - ), - ], - ); - }, - ), + ), + if (hasTopic) + iconButton( + size: 22, + iconSize: 16, + context: context, + icon: Icons.clear, + bgColor: theme.colorScheme.onInverseSurface, + iconColor: theme.colorScheme.onSurfaceVariant, + onPressed: () => topic.value = null, + ), + ], + ); + }, ), - const SizedBox(height: 5), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: TextField( - controller: _titleEditCtr, - style: const TextStyle(fontWeight: FontWeight.bold), - decoration: InputDecoration( - hintText: '标题,选填20字', - isDense: true, - contentPadding: EdgeInsets.zero, - border: const OutlineInputBorder( - gapPadding: 0, - borderSide: BorderSide.none, - ), - hintStyle: TextStyle( - fontWeight: FontWeight.bold, - color: theme.colorScheme.outline.withValues(alpha: 0.7), - ), + ), + const SizedBox(height: 5), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: TextField( + controller: _titleEditCtr, + style: const TextStyle(fontWeight: FontWeight.bold), + decoration: InputDecoration( + hintText: '标题,选填20字', + isDense: true, + contentPadding: EdgeInsets.zero, + border: const OutlineInputBorder( + gapPadding: 0, + borderSide: BorderSide.none, + ), + hintStyle: TextStyle( + fontWeight: FontWeight.bold, + color: theme.colorScheme.outline.withValues(alpha: 0.7), ), - inputFormatters: [LengthLimitingTextInputFormatter(20)], ), + inputFormatters: [LengthLimitingTextInputFormatter(20)], ), - const SizedBox(height: 5), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: _buildEditWidget(theme), + ), + const SizedBox(height: 5), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: _buildEditWidget(theme), + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Obx(() => _buildPubtimeWidget), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Obx(() => _buildReplyOptionWidget(theme)), + const SizedBox(height: 5), + Obx(() => _buildPrivateWidget(theme)), + ], + ), + ], ), - const SizedBox(height: 16), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Obx(() => _buildPubtimeWidget), - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Obx(() => _buildReplyOptionWidget(theme)), - const SizedBox(height: 5), - Obx(() => _buildPrivateWidget(theme)), - ], - ), - ], - ), - ), - const SizedBox(height: 10), - _buildImageList(theme), - ], - ), + ), + const SizedBox(height: 10), + _buildImageList(theme), + ], ), - _buildToolbar, - buildPanelContainer(Colors.transparent), - ], - ), + ), + _buildToolbar, + buildPanelContainer(Colors.transparent), + ], ); } diff --git a/lib/pages/dynamics_detail/view.dart b/lib/pages/dynamics_detail/view.dart index cd1a7c54..9f3ebabd 100644 --- a/lib/pages/dynamics_detail/view.dart +++ b/lib/pages/dynamics_detail/view.dart @@ -125,7 +125,6 @@ class _DynamicDetailPageState extends State VoidCallback? onDispose, }) => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), titleSpacing: automaticallyImplyLeading ? null : 12, diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index a6d4e27d..cd9ed38f 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -272,71 +272,65 @@ class _LiveRoomPageState extends State ); } - Widget get _buildPH => Scaffold( - resizeToAvoidBottomInset: false, - appBar: _buildAppBar, - backgroundColor: Colors.transparent, - body: Column( - children: _buildBodyP, - ), + Widget get _buildPH => Column( + children: [ + _buildAppBar, + ..._buildBodyP, + ], ); - Widget get _buildPP => Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - body: Stack( - clipBehavior: Clip.none, - children: [ - _buildAppBar, - Column( - children: [ - Obx( - () => Container( - color: Colors.black, - width: Get.width, - margin: isFullScreen - ? null - : EdgeInsets.only( - top: 56 + MediaQuery.paddingOf(context).top, - ), - height: isFullScreen - ? Get.height - - (context.orientation == Orientation.landscape - ? 0 - : MediaQuery.paddingOf(context).top) - : Get.height - 56 - 85 - padding!, - child: videoPlayerPanel( - alignment: isFullScreen ? null : Alignment.topCenter, - ), + Widget get _buildPP => Stack( + clipBehavior: Clip.none, + children: [ + _buildAppBar, + Column( + children: [ + Obx( + () => Container( + color: Colors.black, + width: Get.width, + margin: isFullScreen + ? null + : EdgeInsets.only( + top: 56 + MediaQuery.paddingOf(context).top, + ), + height: isFullScreen + ? Get.height - + (context.orientation == Orientation.landscape + ? 0 + : MediaQuery.paddingOf(context).top) + : Get.height - 56 - 85 - padding!, + child: videoPlayerPanel( + alignment: isFullScreen ? null : Alignment.topCenter, ), ), - ], - ), - Obx( - () => isFullScreen - ? const SizedBox.shrink() - : Positioned( - left: 0, - right: 0, - bottom: 125 + MediaQuery.paddingOf(context).bottom, - child: SizedBox( - height: 125, - child: _buildChatWidget(true), - ), + ), + ], + ), + Obx( + () => isFullScreen + ? const SizedBox.shrink() + : Positioned( + left: 0, + right: 0, + bottom: 125 + MediaQuery.paddingOf(context).bottom, + child: SizedBox( + height: 125, + child: _buildChatWidget(true), ), - ), - Obx( - () => isFullScreen - ? const SizedBox.shrink() - : Positioned( - left: 0, - right: 0, - bottom: 0, - child: _buildInputWidget, - ), - ), - ], - ), + ), + ), + Obx( + () => isFullScreen + ? const SizedBox.shrink() + : Positioned( + left: 0, + right: 0, + bottom: 0, + child: _buildInputWidget, + ), + ), + ], ); @override diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index a66c303c..304d59da 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -202,7 +202,6 @@ class _MainAppState extends State systemNavigationBarIconBrightness: theme.brightness.reverse, ), child: Scaffold( - resizeToAvoidBottomInset: false, extendBody: true, body: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index d0c98e7e..14ec69f5 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -29,7 +29,6 @@ class _SearchPageState extends State { Widget build(BuildContext context) { final theme = Theme.of(context); return Scaffold( - resizeToAvoidBottomInset: true, appBar: AppBar( shape: Border( bottom: BorderSide( diff --git a/lib/pages/video/controller.dart b/lib/pages/video/controller.dart index d58a3470..c783652e 100644 --- a/lib/pages/video/controller.dart +++ b/lib/pages/video/controller.dart @@ -357,13 +357,9 @@ class VideoDetailController extends GetxController } } catch (_) {} } else if (isLoadPrevious) { - if (data.mediaList?.isNotEmpty == true) { - mediaList.insertAll(0, data.mediaList!); - } + mediaList.insertAll(0, data.mediaList!); } else { - if (data.mediaList?.isNotEmpty == true) { - mediaList.addAll(data.mediaList!); - } + mediaList.addAll(data.mediaList!); } } } else { @@ -1477,7 +1473,7 @@ class VideoDetailController extends GetxController } catch (_) {} } - if (GStorage.showViewPoints && playInfo.viewPoints?.isNotEmpty == true) { + if (playInfo.viewPoints?.isNotEmpty == true && GStorage.showViewPoints) { try { viewPointList = playInfo.viewPoints!.map((item) { double start = diff --git a/lib/pages/video/introduction/pgc/view.dart b/lib/pages/video/introduction/pgc/view.dart index 17dcdb03..78c76855 100644 --- a/lib/pages/video/introduction/pgc/view.dart +++ b/lib/pages/video/introduction/pgc/view.dart @@ -416,13 +416,14 @@ class _BangumiIntroPanelState extends State return Row( spacing: 6, children: [ - Text( - (bangumiItem.areas!.isNotEmpty ? bangumiItem.areas!.first.name! : ''), - style: TextStyle( - fontSize: 12, - color: theme.colorScheme.outline, + if (bangumiItem.areas?.isNotEmpty == true) + Text( + bangumiItem.areas!.first.name!, + style: TextStyle( + fontSize: 12, + color: theme.colorScheme.outline, + ), ), - ), Text( bangumiItem.publish!.pubTimeShow!, style: TextStyle( diff --git a/lib/pages/video/medialist/view.dart b/lib/pages/video/medialist/view.dart index 2f6443ed..63cbb480 100644 --- a/lib/pages/video/medialist/view.dart +++ b/lib/pages/video/medialist/view.dart @@ -259,7 +259,7 @@ class _MediaListPanelState ], ), ), - if (showDelBtn && isCurr) + if (showDelBtn && !isCurr) Positioned( right: 12, bottom: -6, diff --git a/lib/pages/video/note/view.dart b/lib/pages/video/note/view.dart index 762c7639..fdbcef5e 100644 --- a/lib/pages/video/note/view.dart +++ b/lib/pages/video/note/view.dart @@ -54,37 +54,39 @@ class _NoteListPageState extends CommonSlidePageState { Widget buildPage(ThemeData theme) { return Scaffold( key: _key, - resizeToAvoidBottomInset: false, - body: Scaffold( - backgroundColor: Colors.transparent, - resizeToAvoidBottomInset: false, - appBar: AppBar( - automaticallyImplyLeading: false, - titleSpacing: 16, - toolbarHeight: 45, - title: Obx( - () => Text( - '笔记${_controller.count.value == -1 ? '' : '(${_controller.count.value})'}'), - ), - bottom: PreferredSize( - preferredSize: const Size.fromHeight(1), - child: Divider( - height: 1, - color: theme.colorScheme.outline.withValues(alpha: 0.1), + body: Column( + children: [ + SizedBox( + height: 45, + child: AppBar( + automaticallyImplyLeading: false, + titleSpacing: 16, + toolbarHeight: 45, + title: Obx( + () => Text( + '笔记${_controller.count.value == -1 ? '' : '(${_controller.count.value})'}'), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1), + child: Divider( + height: 1, + color: theme.colorScheme.outline.withValues(alpha: 0.1), + ), + ), + actions: [ + iconButton( + context: context, + tooltip: '关闭', + icon: Icons.clear, + onPressed: Get.back, + size: 32, + ), + const SizedBox(width: 16), + ], ), ), - actions: [ - iconButton( - context: context, - tooltip: '关闭', - icon: Icons.clear, - onPressed: Get.back, - size: 32, - ), - const SizedBox(width: 16), - ], - ), - body: enableSlide ? slideList(theme) : buildList(theme), + Expanded(child: enableSlide ? slideList(theme) : buildList(theme)) + ], ), ); } diff --git a/lib/pages/video/view_point/view.dart b/lib/pages/video/view_point/view.dart index 2534b1e3..76af3fe6 100644 --- a/lib/pages/video/view_point/view.dart +++ b/lib/pages/video/view_point/view.dart @@ -35,7 +35,6 @@ class _ViewPointsPageState @override Widget buildPage(ThemeData theme) { return Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( automaticallyImplyLeading: false, titleSpacing: 16, diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index 122e4300..b6375d97 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -119,7 +119,6 @@ class PiliScheme { 'id': commentSecondaryId, }, () => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), actions: [ @@ -257,7 +256,6 @@ class PiliScheme { 'enterUri': queryParameters['enterUri'], }, () => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), actions: [ @@ -306,7 +304,6 @@ class PiliScheme { 'type': type, }, () => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), actions: [ @@ -381,7 +378,6 @@ class PiliScheme { 'id': commentSecondaryId, }, () => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), actions: [ @@ -767,7 +763,6 @@ class PiliScheme { 'id': commentSecondaryId, }, () => Scaffold( - resizeToAvoidBottomInset: false, appBar: AppBar( title: const Text('评论详情'), actions: pageType == '1'