chore: Simplify adaptive bottom sheet code
This commit is contained in:
parent
dbf6b372be
commit
f8bb996622
2 changed files with 1 additions and 14 deletions
|
|
@ -146,7 +146,6 @@ class _StartPollBottomSheetState extends State<StartPollBottomSheet> {
|
||||||
),
|
),
|
||||||
title: Text(L10n.of(context).allowMultipleAnswers),
|
title: Text(L10n.of(context).allowMultipleAnswers),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: !isLoading && _canCreate ? _createPoll : null,
|
onPressed: !isLoading && _canCreate ? _createPoll : null,
|
||||||
child: isLoading
|
child: isLoading
|
||||||
|
|
|
||||||
|
|
@ -40,25 +40,13 @@ Future<T?> showAdaptiveBottomSheet<T>({
|
||||||
|
|
||||||
return showModalBottomSheet<T>(
|
return showModalBottomSheet<T>(
|
||||||
context: context,
|
context: context,
|
||||||
useSafeArea: true,
|
builder: builder,
|
||||||
builder: (context) => Padding(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(AppConfig.borderRadius / 2),
|
|
||||||
topRight: Radius.circular(AppConfig.borderRadius / 2),
|
|
||||||
),
|
|
||||||
child: builder(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
useRootNavigator: useRootNavigator,
|
useRootNavigator: useRootNavigator,
|
||||||
isDismissible: isDismissible,
|
isDismissible: isDismissible,
|
||||||
isScrollControlled: isScrollControlled,
|
isScrollControlled: isScrollControlled,
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: min(MediaQuery.sizeOf(context).height - 32, 600),
|
maxHeight: min(MediaQuery.sizeOf(context).height - 32, 600),
|
||||||
maxWidth: FluffyThemes.columnWidth * 1.25,
|
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue