fix: bangumi fav sheet

This commit is contained in:
guozhigq
2024-10-20 14:23:13 +08:00
parent 6fd816c505
commit 7c4dd6027b

View File

@ -146,17 +146,34 @@ class _BangumiInfoState extends State<BangumiInfo> {
}
// 收藏
showFavBottomSheet() {
showFavBottomSheet() async {
if (bangumiIntroController.userInfo.mid == null) {
SmartDialog.showToast('账号未登录');
return;
}
showModalBottomSheet(
context: context,
useRootNavigator: true,
final mediaQueryData = MediaQuery.of(context);
final contentHeight = mediaQueryData.size.height - kToolbarHeight;
final double initialChildSize =
(contentHeight - Get.width * 9 / 16) / contentHeight;
await showModalBottomSheet(
context: Get.context!,
useSafeArea: true,
isScrollControlled: true,
builder: (BuildContext context) {
return FavPanel(ctr: bangumiIntroController);
return DraggableScrollableSheet(
initialChildSize: initialChildSize,
minChildSize: 0,
maxChildSize: 1,
snap: true,
expand: false,
snapSizes: [initialChildSize],
builder: (BuildContext context, ScrollController scrollController) {
return FavPanel(
ctr: bangumiIntroController,
scrollController: scrollController,
);
},
);
},
);
}