showSyncAlertBox function
dynamic
showSyncAlertBox({
- required WidgetBuilder builder,
- bool barrierDismissible = true,
- Color? barrierColor,
- String? barrierLabel,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
- Offset? anchorPoint,
- TraversalEdgeBehavior? traversalEdgeBehavior,
Shows an alert dialog using showDialog without requiring a BuildContext.
This function is useful for showing alert dialogs from anywhere in the app, even outside the widget tree.
Example:
showSyncAlertBox(
builder: (BuildContext context) => AlertDialog(
title: Text('Alert'),
content: Text('This is an alert dialog.'),
),
);
Implementation
showSyncAlertBox({
required WidgetBuilder builder,
bool barrierDismissible = true,
Color? barrierColor,
String? barrierLabel,
bool useSafeArea = true,
bool useRootNavigator = true,
RouteSettings? routeSettings,
Offset? anchorPoint,
TraversalEdgeBehavior? traversalEdgeBehavior,
}) {
showDialog(
context: Utils.navigatorKey.currentContext!,
builder: builder,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
anchorPoint: anchorPoint,
traversalEdgeBehavior: traversalEdgeBehavior);
}