showBlurredModalBottomSheet<T> function
Future<T?>
showBlurredModalBottomSheet<T>({
- required BuildContext context,
- required WidgetBuilder builder,
- double blurSigma = 4.0,
- bool isDismissible = true,
- bool enableDrag = true,
- bool useSafeArea = true,
- BorderRadius? borderRadius,
- double? minHeight,
- double? maxHeight,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Color? backgroundColor,
- Color barrierColor = Colors.black54,
- bool showHandle = false,
- EdgeInsetsGeometry? handleMargin,
- BorderRadiusGeometry? handleRadius,
- Color? handleColor,
- double? handleHeight,
- double? handleWidth,
- ShapeBorder? shape,
- String? barrierLabel,
- BoxConstraints? constraints,
- Clip? clipBehavior,
- RouteSettings? routeSettings,
- AnimationStyle? sheetAnimationStyle,
- AnimationController? transitionAnimationController,
- Offset? anchorPoint,
- bool requestFocus = true,
Shows a modal bottom sheet with a blurred background and customizable UI.
Implementation
Future<T?> showBlurredModalBottomSheet<T>({
required BuildContext context,
required WidgetBuilder builder,
double blurSigma = 4.0,
bool isDismissible = true,
bool enableDrag = true,
bool useSafeArea = true,
BorderRadius? borderRadius,
double? minHeight,
double? maxHeight,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Color? backgroundColor,
Color barrierColor = Colors.black54,
bool showHandle = false,
EdgeInsetsGeometry? handleMargin,
BorderRadiusGeometry? handleRadius,
Color? handleColor,
double? handleHeight,
double? handleWidth,
ShapeBorder? shape,
String? barrierLabel,
bool useRootNavigator = false,
BoxConstraints? constraints,
Clip? clipBehavior,
RouteSettings? routeSettings,
AnimationStyle? sheetAnimationStyle,
AnimationController? transitionAnimationController,
Offset? anchorPoint,
bool requestFocus = true,
}) {
return showModalBottomSheet<T>(
context: context,
isDismissible: isDismissible,
enableDrag: enableDrag,
isScrollControlled: true,
backgroundColor: Colors.transparent,
elevation: 0,
useSafeArea: useSafeArea,
barrierColor: barrierColor,
shape: shape,
barrierLabel: barrierLabel,
useRootNavigator: useRootNavigator,
constraints: constraints,
clipBehavior: clipBehavior,
routeSettings: routeSettings,
showDragHandle: false,
sheetAnimationStyle: sheetAnimationStyle,
transitionAnimationController: transitionAnimationController,
anchorPoint: anchorPoint,
requestFocus: requestFocus,
builder: (context) {
final mediaQuery = MediaQuery.of(context);
final defaultMaxHeight = maxHeight ?? (mediaQuery.size.height - mediaQuery.viewInsets.bottom) * 0.9;
return useSafeArea
? SafeArea(
child: _body(
blurSigma,
isDismissible,
context,
margin,
minHeight,
defaultMaxHeight,
mediaQuery,
backgroundColor,
borderRadius,
showHandle,
handleWidth,
handleHeight,
handleMargin,
handleColor,
handleRadius,
padding,
builder),
)
: _body(
blurSigma,
isDismissible,
context,
margin,
minHeight,
defaultMaxHeight,
mediaQuery,
backgroundColor,
borderRadius,
showHandle,
handleWidth,
handleHeight,
handleMargin,
handleColor,
handleRadius,
padding,
builder);
},
);
}