fix: bangumi fav sheet
This commit is contained in:
@ -146,17 +146,34 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
showFavBottomSheet() {
|
showFavBottomSheet() async {
|
||||||
if (bangumiIntroController.userInfo.mid == null) {
|
if (bangumiIntroController.userInfo.mid == null) {
|
||||||
SmartDialog.showToast('账号未登录');
|
SmartDialog.showToast('账号未登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showModalBottomSheet(
|
final mediaQueryData = MediaQuery.of(context);
|
||||||
context: context,
|
final contentHeight = mediaQueryData.size.height - kToolbarHeight;
|
||||||
useRootNavigator: true,
|
final double initialChildSize =
|
||||||
|
(contentHeight - Get.width * 9 / 16) / contentHeight;
|
||||||
|
await showModalBottomSheet(
|
||||||
|
context: Get.context!,
|
||||||
|
useSafeArea: true,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
builder: (BuildContext context) {
|
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,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user