CupertinoButton.tinted constructor
- Key? key,
- required Widget child,
- CupertinoButtonSize sizeStyle = CupertinoButtonSize.large,
- EdgeInsetsGeometry? padding,
- Color? color,
- Color disabledColor = CupertinoColors.tertiarySystemFill,
- @Deprecated('Use minimumSize instead. ' 'This feature was deprecated after v3.28.0-3.0.pre.') double? minSize,
- Size? minimumSize,
- double? pressedOpacity = 0.4,
- BorderRadius? borderRadius,
- AlignmentGeometry alignment = Alignment.center,
- Color? focusColor,
- FocusNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - bool autofocus = false,
- VoidCallback? onLongPress,
- required VoidCallback? onPressed,
Creates an iOS-style button with a tinted background.
The background color is derived from the CupertinoTheme's primaryColor
+ transparency.
The foreground color is the CupertinoTheme's primaryColor
.
To specify a custom background color, use the color
argument of the
default constructor.
To match the iOS "grey" button style, set color
to CupertinoColors.systemGrey.
Implementation
const CupertinoButton.tinted({
super.key,
required this.child,
this.sizeStyle = CupertinoButtonSize.large,
this.padding,
this.color,
this.disabledColor = CupertinoColors.tertiarySystemFill,
@Deprecated(
'Use minimumSize instead. '
'This feature was deprecated after v3.28.0-3.0.pre.',
)
this.minSize,
this.minimumSize,
this.pressedOpacity = 0.4,
this.borderRadius,
this.alignment = Alignment.center,
this.focusColor,
this.focusNode,
this.onFocusChange,
this.autofocus = false,
this.onLongPress,
required this.onPressed,
}) : assert(minimumSize == null || minSize == null),
_style = _CupertinoButtonStyle.tinted;