zenithShowModalBottomSheet<T> method

Future<T?> zenithShowModalBottomSheet<T>({
  1. required Widget builder(
    1. BuildContext sheetContext
    ),
  2. bool isScrollControlled = false,
  3. bool useRootNavigator = false,
  4. bool isDismissible = true,
  5. Color? backgroundColor,
  6. ShapeBorder? shape,
})

Shows a modal bottom sheet with the parent ZenithTenantScope tunnelled into the sheet's widget subtree.

Implementation

Future<T?> zenithShowModalBottomSheet<T>({
  required Widget Function(BuildContext sheetContext) builder,
  bool isScrollControlled = false,
  bool useRootNavigator = false,
  bool isDismissible = true,
  Color? backgroundColor,
  ShapeBorder? shape,
}) {
  final scope = ZenithScopeProvider.maybeOf(this);
  return showModalBottomSheet<T>(
    context: this,
    isScrollControlled: isScrollControlled,
    useRootNavigator: useRootNavigator,
    isDismissible: isDismissible,
    backgroundColor: backgroundColor,
    shape: shape,
    builder: (sheetContext) => scope != null
        ? ZenithScopeProvider(
            scope: scope,
            child: Builder(builder: builder),
          )
        : Builder(builder: builder),
  );
}