createCupertinoWidget method
Implementation
@override
Widget createCupertinoWidget(BuildContext context) {
final data = cupertino?.call(context, platform(context));
Curve? curve = data?.insetAnimationCurve;
final providerState = PlatformProvider.of(context);
final useLegacyMaterial =
providerState?.settings.legacyIosUsesMaterialWidgets ?? false;
final useMaterial = providerState?.settings.iosUsesMaterialWidgets ?? false;
final result = CupertinoAlertDialog(
key: data?.widgetKey ?? widgetKey,
actions: data?.actions ?? actions ?? const <Widget>[],
content: (data?.content ?? content)?.withMaterial(useMaterial),
scrollController: data?.scrollController,
actionScrollController: data?.actionScrollController,
title: data?.title ?? title,
insetAnimationCurve: curve ?? Curves.decelerate,
insetAnimationDuration:
data?.insetAnimationDuration ?? Duration(milliseconds: 100),
);
// Ensure that there is Material widget at the root page level
// as there can be Material widgets used on ios
return result.withMaterial(useLegacyMaterial &&
context.findAncestorWidgetOfExactType<Material>() == null);
}