mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 收藏夹横屏适配、视频条数修正、界面微调
This commit is contained in:
@@ -9,6 +9,8 @@ import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
|||||||
import 'package:PiliPalaX/common/widgets/no_data.dart';
|
import 'package:PiliPalaX/common/widgets/no_data.dart';
|
||||||
import 'package:PiliPalaX/pages/fav_detail/index.dart';
|
import 'package:PiliPalaX/pages/fav_detail/index.dart';
|
||||||
|
|
||||||
|
import '../../common/constants.dart';
|
||||||
|
import '../../utils/grid.dart';
|
||||||
import 'widget/fav_video_card.dart';
|
import 'widget/fav_video_card.dart';
|
||||||
|
|
||||||
class FavDetailPage extends StatefulWidget {
|
class FavDetailPage extends StatefulWidget {
|
||||||
@@ -63,7 +65,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
controller: _controller,
|
controller: _controller,
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
expandedHeight: 260 - MediaQuery.of(context).padding.top,
|
expandedHeight: 220 - MediaQuery.of(context).padding.top,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: StreamBuilder(
|
title: StreamBuilder(
|
||||||
@@ -109,21 +111,21 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
],
|
],
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: Container(
|
background: Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: Border(
|
// border: Border(
|
||||||
bottom: BorderSide(
|
// bottom: BorderSide(
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.2),
|
// color: Theme.of(context).dividerColor.withOpacity(0.2),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: kTextTabBarHeight +
|
top: kTextTabBarHeight +
|
||||||
MediaQuery.of(context).padding.top +
|
MediaQuery.of(context).padding.top +
|
||||||
30,
|
10,
|
||||||
left: 20,
|
left: 14,
|
||||||
right: 20),
|
right: 20),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 200,
|
height: 110,
|
||||||
child: Row(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -161,7 +163,18 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
.labelSmall!
|
.labelSmall!
|
||||||
.fontSize,
|
.fontSize,
|
||||||
color: Theme.of(context).colorScheme.outline),
|
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<FavDetailPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
// SliverToBoxAdapter(
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 15, bottom: 8, left: 14),
|
// padding: const EdgeInsets.only(top: 15, bottom: 8, left: 14),
|
||||||
child: Obx(
|
// child: Obx(
|
||||||
() => Text(
|
// () => Text(
|
||||||
'共${_favDetailController.favList.length}条视频',
|
// '共${_favDetailController.favList.length}条视频',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontSize:
|
// fontSize:
|
||||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
// Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
// color: Theme.of(context).colorScheme.outline,
|
||||||
letterSpacing: 1),
|
// letterSpacing: 1),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
@@ -199,7 +212,18 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
return Obx(
|
return Obx(
|
||||||
() => favList.isEmpty
|
() => favList.isEmpty
|
||||||
? const SliverToBoxAdapter(child: SizedBox())
|
? 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:
|
delegate:
|
||||||
SliverChildBuilderDelegate((context, index) {
|
SliverChildBuilderDelegate((context, index) {
|
||||||
return FavVideoCardH(
|
return FavVideoCardH(
|
||||||
|
|||||||
Reference in New Issue
Block a user