mod: bottomSheet样式

This commit is contained in:
guozhigq
2024-08-26 23:48:12 +08:00
parent a5e2414a75
commit cc5f432f4a
5 changed files with 201 additions and 215 deletions

View File

@ -49,7 +49,10 @@ class FollowItem extends StatelessWidget {
child: TextButton( child: TextButton(
onPressed: () async { onPressed: () async {
await showFlexibleBottomSheet( await showFlexibleBottomSheet(
bottomSheetColor: Colors.transparent, bottomSheetBorderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
minHeight: 1, minHeight: 1,
initHeight: 1, initHeight: 1,
maxHeight: 1, maxHeight: 1,

View File

@ -519,7 +519,10 @@ class VideoIntroController extends GetxController {
// 设置关注分组 // 设置关注分组
void setFollowGroup() { void setFollowGroup() {
showFlexibleBottomSheet( showFlexibleBottomSheet(
bottomSheetColor: Colors.transparent, bottomSheetBorderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
minHeight: 0.6, minHeight: 0.6,
initHeight: 0.6, initHeight: 0.6,
maxHeight: 1, maxHeight: 1,

View File

@ -230,7 +230,10 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
void _showFavPanel() { void _showFavPanel() {
showFlexibleBottomSheet( showFlexibleBottomSheet(
bottomSheetColor: Colors.transparent, bottomSheetBorderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
minHeight: 0.6, minHeight: 0.6,
initHeight: 0.6, initHeight: 0.6,
maxHeight: 1, maxHeight: 1,

View File

@ -26,16 +26,7 @@ class _FavPanelState extends State<FavPanel> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Column(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
),
child: Column(
children: [ children: [
AppBar( AppBar(
centerTitle: false, centerTitle: false,
@ -61,19 +52,18 @@ class _FavPanelState extends State<FavPanel> {
return Obx( return Obx(
() => ListView.builder( () => ListView.builder(
controller: widget.scrollController, controller: widget.scrollController,
itemCount: itemCount: widget.ctr!.favFolderData.value.list!.length,
widget.ctr!.favFolderData.value.list!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = final item =
widget.ctr!.favFolderData.value.list![index]; widget.ctr!.favFolderData.value.list![index];
return ListTile( return ListTile(
onTap: () => widget.ctr! onTap: () =>
.onChoose(item.favState != 1, index), widget.ctr!.onChoose(item.favState != 1, index),
dense: true, dense: true,
leading: const Icon(Icons.folder_outlined), leading: const Icon(Icons.folder_outlined),
minLeadingWidth: 0, minLeadingWidth: 0,
title: Text(widget.ctr!.favFolderData.value title: Text(widget
.list![index].title!), .ctr!.favFolderData.value.list![index].title!),
subtitle: Text( subtitle: Text(
'${item.mediaCount}个内容 ', '${item.mediaCount}个内容 ',
), ),
@ -123,9 +113,8 @@ class _FavPanelState extends State<FavPanel> {
onPressed: () => Get.back(), onPressed: () => Get.back(),
style: TextButton.styleFrom( style: TextButton.styleFrom(
padding: const EdgeInsets.only(left: 30, right: 30), padding: const EdgeInsets.only(left: 30, right: 30),
backgroundColor: Theme.of(context) backgroundColor:
.colorScheme Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色
.onInverseSurface, // 设置按钮背景色
), ),
child: const Text('取消'), child: const Text('取消'),
), ),
@ -141,13 +130,12 @@ class _FavPanelState extends State<FavPanel> {
backgroundColor: backgroundColor:
Theme.of(context).colorScheme.primary, // 设置按钮背景色 Theme.of(context).colorScheme.primary, // 设置按钮背景色
), ),
child: const Text('确认选择'), child: const Text('确认'),
), ),
], ],
), ),
), ),
], ],
),
); );
} }
} }

View File

@ -54,16 +54,7 @@ class _GroupPanelState extends State<GroupPanel> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Column(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
),
child: Column(
children: <Widget>[ children: <Widget>[
AppBar( AppBar(
centerTitle: false, centerTitle: false,
@ -71,8 +62,7 @@ class _GroupPanelState extends State<GroupPanel> {
leading: IconButton( leading: IconButton(
onPressed: () => Get.back(), onPressed: () => Get.back(),
icon: const Icon(Icons.close_outlined)), icon: const Icon(Icons.close_outlined)),
title: title: Text('设置关注分组', style: Theme.of(context).textTheme.titleMedium),
Text('设置关注分组', style: Theme.of(context).textTheme.titleMedium),
), ),
Expanded( Expanded(
child: Material( child: Material(
@ -108,8 +98,8 @@ class _GroupPanelState extends State<GroupPanel> {
value: data['data'][index].checked, value: data['data'][index].checked,
onChanged: (bool? checkValue) { onChanged: (bool? checkValue) {
data['data'][index].checked = checkValue; data['data'][index].checked = checkValue;
showDefault = !data['data'] showDefault =
.any((e) => e.checked == true); !data['data'].any((e) => e.checked == true);
setState(() {}); setState(() {});
}, },
), ),
@ -159,7 +149,6 @@ class _GroupPanelState extends State<GroupPanel> {
), ),
), ),
], ],
),
); );
} }
} }