fix: Make keyboard moving bottom sheet up

This commit is contained in:
Christian Kußowski 2025-11-17 13:51:19 +01:00
parent f8bb996622
commit 09f96e48d1
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -40,13 +40,20 @@ Future<T?> showAdaptiveBottomSheet<T>({
return showModalBottomSheet<T>(
context: context,
builder: builder,
builder: (context) => ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.viewInsetsOf(context).bottom +
min(
MediaQuery.sizeOf(context).height - 32,
600,
),
),
child: builder(context),
),
useSafeArea: true,
useRootNavigator: useRootNavigator,
isDismissible: isDismissible,
isScrollControlled: isScrollControlled,
constraints: BoxConstraints(
maxHeight: min(MediaQuery.sizeOf(context).height - 32, 600),
),
clipBehavior: Clip.hardEdge,
);
}