createCupertinoWidget method Null safety

  1. @override
CupertinoButton createCupertinoWidget(
  1. BuildContext context
)
override

Implementation

@override
CupertinoButton createCupertinoWidget(BuildContext context) {
  final data = cupertino?.call(context, platform(context));

  if (data?.originalStyle ?? false) {
    return CupertinoButton.filled(
      key: data?.widgetKey ?? widgetKey,
      child: data?.child ?? child!,
      onPressed: data?.onPressed ?? onPressed,
      borderRadius: data?.borderRadius ??
          const BorderRadius.all(const Radius.circular(8.0)),
      minSize: data?.minSize ?? _kMinInteractiveDimensionCupertino,
      padding: data?.padding ?? padding,
      pressedOpacity: data?.pressedOpacity ?? 0.4,
      disabledColor:
          data?.disabledColor ?? CupertinoColors.quaternarySystemFill,
      alignment: data?.alignment ?? alignment ?? Alignment.center,
    );
  } else {
    return CupertinoButton(
      key: data?.widgetKey ?? widgetKey,
      child: data?.child ?? child!,
      onPressed: data?.onPressed ?? onPressed,
      borderRadius: data?.borderRadius ??
          const BorderRadius.all(const Radius.circular(8.0)),
      minSize: data?.minSize ?? _kMinInteractiveDimensionCupertino,
      padding: data?.padding ?? padding,
      pressedOpacity: data?.pressedOpacity ?? 0.4,
      disabledColor:
          data?.disabledColor ?? CupertinoColors.quaternarySystemFill,
      alignment: data?.alignment ?? alignment ?? Alignment.center,
      color: data?.color,
    );
  }
}