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,
- String? id,
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,
String? id}) {
assert(!barrierDismissible || barrierLabel != null);
final key = navigatorKey ?? Get.nestedKey(id)?.navigatorKey;
final nav = key?.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,
),
);
}