showNikuDialog function
Future<void>
showNikuDialog({
- required BuildContext context,
- required Widget builder(),
- String? barrierLabel,
- bool? barrierDismissible,
Implementation
Future<void> showNikuDialog({
required BuildContext context,
required Widget Function(BuildContext) builder,
String? barrierLabel,
bool useRootNavigator = true,
bool? barrierDismissible,
}) async {
final alert = builder(context);
if (alert is NikuAlert) {
if (alert.adaptive) {
final platform = Theme.of(context).platform;
if (platform == TargetPlatform.macOS || platform == TargetPlatform.iOS)
return showCupertinoDialog(
context: context,
builder: builder,
barrierLabel: barrierLabel,
barrierDismissible: barrierDismissible ?? false,
useRootNavigator: useRootNavigator,
);
}
if (alert.cupertino)
return showCupertinoDialog(
context: context,
builder: builder,
barrierLabel: barrierLabel,
barrierDismissible: barrierDismissible ?? false,
useRootNavigator: useRootNavigator,
);
}
return showDialog(
context: context,
builder: builder,
barrierLabel: barrierLabel,
barrierDismissible: barrierDismissible ?? true,
useRootNavigator: useRootNavigator,
);
}