CupertinoButton constructor Null safety

const CupertinoButton(
  1. {Key? key,
  2. required Widget child,
  3. EdgeInsetsGeometry? padding,
  4. Color? color,
  5. Color disabledColor = CupertinoColors.quaternarySystemFill,
  6. double? minSize = kMinInteractiveDimensionCupertino,
  7. double? pressedOpacity = 0.4,
  8. BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  9. AlignmentGeometry alignment = Alignment.center,
  10. required VoidCallback? onPressed}
)

Creates an iOS-style button.

Implementation

const CupertinoButton({
  super.key,
  required this.child,
  this.padding,
  this.color,
  this.disabledColor = CupertinoColors.quaternarySystemFill,
  this.minSize = kMinInteractiveDimensionCupertino,
  this.pressedOpacity = 0.4,
  this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  this.alignment = Alignment.center,
  required this.onPressed,
}) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)),
     assert(disabledColor != null),
     assert(alignment != null),
     _filled = false;