From c9acd4109f095dd71a080fcd9b228e963dc1018c Mon Sep 17 00:00:00 2001 From: orz12 Date: Wed, 6 Mar 2024 15:58:53 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E6=94=B6=E8=97=8F=E5=A4=B9=E6=A8=AA?= =?UTF-8?q?=E5=B1=8F=E9=80=82=E9=85=8D=E3=80=81=E8=A7=86=E9=A2=91=E6=9D=A1?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=AD=A3=E3=80=81=E7=95=8C=E9=9D=A2=E5=BE=AE?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/fav_detail/view.dart | 80 ++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 045c63db8..543e3fe37 100644 --- a/lib/pages/fav_detail/view.dart +++ b/lib/pages/fav_detail/view.dart @@ -9,6 +9,8 @@ import 'package:PiliPalaX/common/widgets/network_img_layer.dart'; import 'package:PiliPalaX/common/widgets/no_data.dart'; import 'package:PiliPalaX/pages/fav_detail/index.dart'; +import '../../common/constants.dart'; +import '../../utils/grid.dart'; import 'widget/fav_video_card.dart'; class FavDetailPage extends StatefulWidget { @@ -63,7 +65,7 @@ class _FavDetailPageState extends State { controller: _controller, slivers: [ SliverAppBar( - expandedHeight: 260 - MediaQuery.of(context).padding.top, + expandedHeight: 220 - MediaQuery.of(context).padding.top, pinned: true, titleSpacing: 0, title: StreamBuilder( @@ -109,21 +111,21 @@ class _FavDetailPageState extends State { ], flexibleSpace: FlexibleSpaceBar( background: Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.2), - ), - ), - ), + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Theme.of(context).dividerColor.withOpacity(0.2), + // ), + // ), + // ), padding: EdgeInsets.only( top: kTextTabBarHeight + MediaQuery.of(context).padding.top + - 30, - left: 20, + 10, + left: 14, right: 20), child: SizedBox( - height: 200, + height: 110, child: Row( // mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -161,7 +163,18 @@ class _FavDetailPageState extends State { .labelSmall! .fontSize, color: Theme.of(context).colorScheme.outline), - ) + ), + const Spacer(), + Text( + '共${_favDetailController.item!.mediaCount!}条视频', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelSmall! + .fontSize, + color: Theme.of(context).colorScheme.outline), + ), + const SizedBox(height: 20), ], ), ), @@ -171,21 +184,21 @@ class _FavDetailPageState extends State { ), ), ), - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.only(top: 15, bottom: 8, left: 14), - child: Obx( - () => Text( - '共${_favDetailController.favList.length}条视频', - style: TextStyle( - fontSize: - Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - letterSpacing: 1), - ), - ), - ), - ), + // SliverToBoxAdapter( + // child: Padding( + // padding: const EdgeInsets.only(top: 15, bottom: 8, left: 14), + // child: Obx( + // () => Text( + // '共${_favDetailController.favList.length}条视频', + // style: TextStyle( + // fontSize: + // Theme.of(context).textTheme.labelMedium!.fontSize, + // color: Theme.of(context).colorScheme.outline, + // letterSpacing: 1), + // ), + // ), + // ), + // ), FutureBuilder( future: _futureBuilderFuture, builder: (context, snapshot) { @@ -199,7 +212,18 @@ class _FavDetailPageState extends State { return Obx( () => favList.isEmpty ? const SliverToBoxAdapter(child: SizedBox()) - : SliverList( + : SliverGrid( + gridDelegate: + SliverGridDelegateWithMaxCrossAxisExtent( + mainAxisSpacing: StyleString.cardSpace, + crossAxisSpacing: StyleString.safeSpace, + maxCrossAxisExtent: Grid.maxRowWidth * 2, + mainAxisExtent: Grid.calculateActualWidth( + context, + Grid.maxRowWidth * 2, + StyleString.safeSpace) / + 1.9 / + StyleString.aspectRatio), delegate: SliverChildBuilderDelegate((context, index) { return FavVideoCardH(