mirror of
https://github.com/krille-chan/fluffychat
synced 2024-10-10 17:03:38 +00:00
5257d89b53
Signed-off-by: The one with the braid <info@braid.business>
31 lines
1,022 B
Dart
31 lines
1,022 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fluffychat/config/app_config.dart';
|
|
import 'package:fluffychat/config/themes.dart';
|
|
|
|
Future<T?> showAdaptiveBottomSheet<T>({
|
|
required BuildContext context,
|
|
required Widget Function(BuildContext) builder,
|
|
bool isDismissible = true,
|
|
bool isScrollControlled = true,
|
|
double maxHeight = 480.0,
|
|
}) =>
|
|
showModalBottomSheet(
|
|
context: context,
|
|
builder: builder,
|
|
// this sadly is ugly on desktops but otherwise breaks `.of(context)` calls
|
|
useRootNavigator: false,
|
|
isDismissible: isDismissible,
|
|
isScrollControlled: isScrollControlled,
|
|
constraints: BoxConstraints(
|
|
maxHeight: maxHeight,
|
|
maxWidth: FluffyThemes.columnWidth * 1.5,
|
|
),
|
|
clipBehavior: Clip.hardEdge,
|
|
shape: const RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(AppConfig.borderRadius),
|
|
topRight: Radius.circular(AppConfig.borderRadius),
|
|
),
|
|
),
|
|
);
|