generalDialog<T> method
Future<T?>
generalDialog<T>({
- required RoutePageBuilder pageBuilder,
- bool barrierDismissible = false,
- String? barrierLabel,
- Color barrierColor = const Color(0x80000000),
- Duration transitionDuration = const Duration(milliseconds: 200),
- RouteTransitionsBuilder? transitionBuilder,
- RouteSettings? routeSettings,
Api from showGeneralDialog with no context
Implementation
Future<T?> generalDialog<T>({
required RoutePageBuilder pageBuilder,
bool barrierDismissible = false,
String? barrierLabel,
Color barrierColor = const Color(0x80000000),
Duration transitionDuration = const Duration(milliseconds: 200),
RouteTransitionsBuilder? transitionBuilder,
GlobalKey<NavigatorState>? navigatorKey,
RouteSettings? routeSettings,
}) {
assert(!barrierDismissible || barrierLabel != null);
final nav = navigatorKey?.currentState ??
Navigator.of(overlayContext!,
rootNavigator:
true); //overlay context will always return the root navigator
return nav.push<T>(
GetDialogRoute<T>(
pageBuilder: pageBuilder,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
transitionDuration: transitionDuration,
transitionBuilder: transitionBuilder,
settings: routeSettings,
),
);
}