showProviderAwareBottomSheet<T> method
Future<T?>
showProviderAwareBottomSheet<T>({
- required Widget builder(),
- bool isScrollControlled = true,
- bool showDragHandle = true,
- bool isDismissible = true,
- bool enableDrag = true,
- Color? backgroundColor,
- double? elevation,
- ShapeBorder? shape,
- Clip? clipBehavior,
- BoxConstraints? constraints,
- Color? barrierColor,
- RouteSettings? routeSettings,
Shows a modal bottom sheet that maintains access to Riverpod providers.
This automatically wraps the builder content in an UncontrolledProviderScope so that widgets inside the modal can access providers from the parent context.
Implementation
Future<T?> showProviderAwareBottomSheet<T>({
required Widget Function(BuildContext) builder,
bool isScrollControlled = true,
bool showDragHandle = true,
bool isDismissible = true,
bool enableDrag = true,
Color? backgroundColor,
double? elevation,
ShapeBorder? shape,
Clip? clipBehavior,
BoxConstraints? constraints,
Color? barrierColor,
bool useRootNavigator = false,
RouteSettings? routeSettings,
}) {
return showModalBottomSheet<T>(
context: this,
isScrollControlled: isScrollControlled,
showDragHandle: showDragHandle,
isDismissible: isDismissible,
enableDrag: enableDrag,
backgroundColor: backgroundColor,
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
constraints: constraints,
barrierColor: barrierColor,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
builder: (modalContext) {
return UncontrolledProviderScope(
container: ProviderScope.containerOf(this),
child: builder(modalContext),
);
},
);
}