diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 045c63db..543e3fe3 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(