createCupertinoWidget method

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

Implementation

@override
CupertinoButton createCupertinoWidget(BuildContext context) {
  if (cupertinoFilled != null) {
    final filledData = cupertinoFilled(context, platform(context));

    return CupertinoButton.filled(
      key: filledData?.widgetKey ?? widgetKey,
      child: filledData?.child ?? child,
      onPressed: filledData?.onPressed ?? onPressed,
      borderRadius: filledData?.borderRadius ??
          const BorderRadius.all(const Radius.circular(8.0)),
      minSize: filledData?.minSize ?? _kMinInteractiveDimensionCupertino,
      padding: filledData?.padding ?? padding,
      pressedOpacity: filledData?.pressedOpacity ?? 0.4,
      disabledColor: filledData?.disabledColor ??
          disabledColor ??
          CupertinoColors.quaternarySystemFill,
    );
  }

  final data = cupertino?.call(context, platform(context));

  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)),
    color: data?.color ?? color,
    minSize: data?.minSize ?? _kMinInteractiveDimensionCupertino,
    padding: data?.padding ?? padding,
    pressedOpacity: data?.pressedOpacity ?? 0.4,
    disabledColor: data?.disabledColor ??
        disabledColor ??
        CupertinoColors.quaternarySystemFill,
  );
}