mod: 收藏夹样式

This commit is contained in:
guozhigq
2023-08-12 17:58:46 +08:00
parent 58cdcdabb5
commit 43866cbbfc
4 changed files with 92 additions and 63 deletions

View File

@ -210,7 +210,10 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
}), }),
), ),
onPressed: showIntroDetail, onPressed: showIntroDetail,
icon: const Icon(Icons.more_horiz), icon: Icon(
Icons.more_horiz,
color: Theme.of(context).colorScheme.primary,
),
), ),
), ),
], ],

View File

@ -33,24 +33,13 @@ class _FavPanelState extends State<FavPanel> {
child: Column( child: Column(
children: [ children: [
AppBar( AppBar(
toolbarHeight: 50,
automaticallyImplyLeading: false,
centerTitle: false, centerTitle: false,
elevation: 1, elevation: 0,
title: Text( leading: IconButton(
'选择文件夹', onPressed: () => Get.back(),
style: Theme.of(context).textTheme.titleMedium, icon: const Icon(Icons.close_outlined)),
), title:
actions: [ Text('添加到收藏夹', style: Theme.of(context).textTheme.titleMedium),
TextButton(
onPressed: () async {
feedBack();
await widget.ctr!.actionFavVideo();
},
child: const Text('完成'),
),
const SizedBox(width: 6),
],
), ),
Expanded( Expanded(
child: Material( child: Material(
@ -63,45 +52,33 @@ class _FavPanelState extends State<FavPanel> {
return Obx( return Obx(
() => ListView.builder( () => ListView.builder(
itemCount: itemCount:
widget.ctr!.favFolderData.value.list!.length + 1, widget.ctr!.favFolderData.value.list!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == 0) { return ListTile(
return const SizedBox(height: 10); onTap: () => widget.ctr!.onChoose(
} else { widget.ctr!.favFolderData.value.list![index]
return ListTile( .favState !=
onTap: () => widget.ctr!.onChoose( 1,
widget.ctr!.favFolderData.value index),
.list![index - 1].favState != dense: true,
1, leading: const Icon(Icons.folder_outlined),
index - 1), minLeadingWidth: 0,
dense: true, title: Text(widget.ctr!.favFolderData.value
leading: .list![index].title!),
const Icon(Icons.folder_special_outlined), subtitle: Text(
minLeadingWidth: 0, '${widget.ctr!.favFolderData.value.list![index].mediaCount}个内容',
title: Text(widget.ctr!.favFolderData.value ),
.list![index - 1].title!), trailing: Transform.scale(
subtitle: Text( scale: 0.9,
'${widget.ctr!.favFolderData.value.list![index - 1].mediaCount}个内容', child: Checkbox(
style: TextStyle( value: widget.ctr!.favFolderData.value
color: .list![index].favState ==
Theme.of(context).colorScheme.outline, 1,
fontSize: Theme.of(context) onChanged: (bool? checkValue) =>
.textTheme widget.ctr!.onChoose(checkValue!, index),
.labelSmall!
.fontSize),
), ),
trailing: Transform.scale( ),
scale: 0.9, );
child: Checkbox(
value: widget.ctr!.favFolderData.value
.list![index - 1].favState ==
1,
onChanged: (bool? checkValue) => widget.ctr!
.onChoose(checkValue!, index - 1),
),
),
);
}
}, },
), ),
); );
@ -119,6 +96,46 @@ class _FavPanelState extends State<FavPanel> {
), ),
), ),
), ),
Divider(
height: 1,
color: Theme.of(context).disabledColor.withOpacity(0.08),
),
Padding(
padding: EdgeInsets.only(
left: 20,
right: 20,
top: 12,
bottom: MediaQuery.of(context).padding.bottom),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Get.back(),
style: TextButton.styleFrom(
padding: const EdgeInsets.only(left: 30, right: 30),
backgroundColor: Theme.of(context)
.colorScheme
.onInverseSurface, // 设置按钮背景色
),
child: const Text('取消'),
),
const SizedBox(width: 10),
TextButton(
onPressed: () async {
feedBack();
await widget.ctr!.actionFavVideo();
},
style: TextButton.styleFrom(
padding: const EdgeInsets.only(left: 30, right: 30),
foregroundColor: Theme.of(context).colorScheme.onPrimary,
backgroundColor:
Theme.of(context).colorScheme.primary, // 设置按钮背景色
),
child: const Text('完成'),
),
],
),
),
], ],
), ),
); );

View File

@ -37,10 +37,7 @@ class IntroDetail extends StatelessWidget {
width: 32, width: 32,
height: 3, height: 3,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context) color: Theme.of(context).colorScheme.primary,
.colorScheme
.onSecondaryContainer
.withOpacity(0.5),
borderRadius: borderRadius:
const BorderRadius.all(Radius.circular(3))), const BorderRadius.all(Radius.circular(3))),
), ),

View File

@ -1,11 +1,13 @@
import 'dart:async'; import 'dart:async';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'; import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart';
import 'package:pilipala/common/widgets/sliver_header.dart'; import 'package:pilipala/common/widgets/sliver_header.dart';
import 'package:pilipala/http/user.dart';
import 'package:pilipala/models/common/search_type.dart'; import 'package:pilipala/models/common/search_type.dart';
import 'package:pilipala/pages/bangumi/introduction/index.dart'; import 'package:pilipala/pages/bangumi/introduction/index.dart';
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart'; import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
@ -156,8 +158,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
scrolledUnderElevation: 0, scrolledUnderElevation: 0,
forceElevated: innerBoxIsScrolled, forceElevated: innerBoxIsScrolled,
expandedHeight: videoHeight, expandedHeight: videoHeight,
// backgroundColor: Colors.transparent, backgroundColor:
backgroundColor: Theme.of(context).colorScheme.background, MediaQuery.of(Get.context!).platformBrightness ==
Brightness.dark
? Colors.black
: Theme.of(context).colorScheme.background,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
background: Padding( background: Padding(
padding: EdgeInsets.only(top: statusBarHeight), padding: EdgeInsets.only(top: statusBarHeight),
@ -226,10 +231,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
backgroundColor: backgroundColor:
Colors.transparent, Colors.transparent,
actions: [ actions: [
/// TODO
IconButton( IconButton(
tooltip: '稍后再看', tooltip: '稍后再看',
onPressed: () {}, onPressed: () async {
var res = await UserHttp
.toViewLater(
bvid:
videoDetailController
.bvid);
SmartDialog.showToast(
res['msg']);
},
icon: const Icon(Icons icon: const Icon(Icons
.history_outlined)) .history_outlined))
], ],