showProviderAwareDialog<T> method
Future<T?>
showProviderAwareDialog<T>({
- required Widget builder(),
- bool barrierDismissible = true,
- Color? barrierColor,
- String? barrierLabel,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
- Offset? anchorPoint,
- TraversalEdgeBehavior? traversalEdgeBehavior,
Shows a dialog that maintains access to Riverpod providers.
This automatically wraps the builder content in an UncontrolledProviderScope so that widgets inside the dialog can access providers from the parent context.
Implementation
Future<T?> showProviderAwareDialog<T>({
required Widget Function(BuildContext) builder,
bool barrierDismissible = true,
Color? barrierColor,
String? barrierLabel,
bool useSafeArea = true,
bool useRootNavigator = true,
RouteSettings? routeSettings,
Offset? anchorPoint,
TraversalEdgeBehavior? traversalEdgeBehavior,
}) {
return showDialog<T>(
context: this,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
anchorPoint: anchorPoint,
traversalEdgeBehavior: traversalEdgeBehavior,
builder: (dialogContext) {
return UncontrolledProviderScope(
container: ProviderScope.containerOf(this),
child: builder(dialogContext),
);
},
);
}