showLevitModalBottomSheet<T> function

Future<T?> showLevitModalBottomSheet<T>({
  1. required BuildContext context,
  2. required WidgetBuilder builder,
  3. Color? backgroundColor,
  4. String? barrierLabel,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. Clip? clipBehavior,
  8. BoxConstraints? constraints,
  9. Color? barrierColor,
  10. bool isScrollControlled = false,
  11. double scrollControlDisabledMaxHeightRatio = 9.0 / 16.0,
  12. bool useRootNavigator = false,
  13. bool isDismissible = true,
  14. bool enableDrag = true,
  15. bool? showDragHandle,
  16. bool useSafeArea = false,
  17. RouteSettings? routeSettings,
  18. AnimationController? transitionAnimationController,
  19. Offset? anchorPoint,
})

Shows a modal bottom sheet that keeps access to the nearest Levit scope.

Wraps the sheet content with LScope.capture so context.levit.find still resolves page- or app-local dependencies inside the overlay route.

Implementation

Future<T?> showLevitModalBottomSheet<T>({
  required BuildContext context,
  required WidgetBuilder builder,
  Color? backgroundColor,
  String? barrierLabel,
  double? elevation,
  ShapeBorder? shape,
  Clip? clipBehavior,
  BoxConstraints? constraints,
  Color? barrierColor,
  bool isScrollControlled = false,
  double scrollControlDisabledMaxHeightRatio = 9.0 / 16.0,
  bool useRootNavigator = false,
  bool isDismissible = true,
  bool enableDrag = true,
  bool? showDragHandle,
  bool useSafeArea = false,
  RouteSettings? routeSettings,
  AnimationController? transitionAnimationController,
  Offset? anchorPoint,
}) {
  return showModalBottomSheet<T>(
    context: context,
    backgroundColor: backgroundColor,
    barrierLabel: barrierLabel,
    elevation: elevation,
    shape: shape,
    clipBehavior: clipBehavior,
    constraints: constraints,
    barrierColor: barrierColor,
    isScrollControlled: isScrollControlled,
    scrollControlDisabledMaxHeightRatio: scrollControlDisabledMaxHeightRatio,
    useRootNavigator: useRootNavigator,
    isDismissible: isDismissible,
    enableDrag: enableDrag,
    showDragHandle: showDragHandle,
    useSafeArea: useSafeArea,
    routeSettings: routeSettings,
    transitionAnimationController: transitionAnimationController,
    anchorPoint: anchorPoint,
    builder: (_) => LScope.capture(
      context,
      child: Builder(builder: builder),
    ),
  );
}