showPlatformDialog<T> function
Future<T?>
showPlatformDialog<T>({
- required BuildContext context,
- MaterialDialogData? material,
- CupertinoDialogData? cupertino,
- WidgetBuilder? builder,
- bool? barrierDismissible,
- RouteSettings? routeSettings,
- String? barrierLabel,
- Offset? anchorPoint,
Implementation
Future<T?> showPlatformDialog<T>({
required BuildContext context,
MaterialDialogData? material,
CupertinoDialogData? cupertino,
WidgetBuilder? builder,
bool? barrierDismissible,
RouteSettings? routeSettings,
bool useRootNavigator = true,
String? barrierLabel,
Offset? anchorPoint,
}) {
if (isMaterial(context)) {
assert(material?.builder != null || builder != null);
return showDialog<T>(
context: context,
builder: material?.builder ?? builder!,
barrierDismissible:
material?.barrierDismissible ?? barrierDismissible ?? true,
routeSettings: material?.routeSettings ?? routeSettings,
useRootNavigator: material?.useRootNavigator ?? useRootNavigator,
useSafeArea: material?.useSafeArea ?? true,
barrierColor: material?.barrierColor ?? Colors.black54,
barrierLabel: material?.barrierLabel ?? barrierLabel,
anchorPoint: material?.anchorPoint ?? anchorPoint,
traversalEdgeBehavior: material?.traversalEdgeBehavior,
);
} else {
assert(cupertino?.builder != null || builder != null);
return showCupertinoDialog<T>(
context: context,
builder: cupertino?.builder ?? builder!,
routeSettings: cupertino?.routeSettings ?? routeSettings,
useRootNavigator: cupertino?.useRootNavigator ?? useRootNavigator,
barrierDismissible:
cupertino?.barrierDismissible ?? barrierDismissible ?? false,
barrierLabel: cupertino?.barrierLabel ?? barrierLabel,
anchorPoint: cupertino?.anchorPoint ?? anchorPoint,
);
}
}