ButtonTheme constructor Null safety
- {Key? key,
- ButtonTextTheme textTheme = ButtonTextTheme.normal,
- ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,
- double minWidth = 88.0,
- double height = 36.0,
- EdgeInsetsGeometry? padding,
- ShapeBorder? shape,
- bool alignedDropdown = false,
- Color? buttonColor,
- Color? disabledColor,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- ColorScheme? colorScheme,
- MaterialTapTargetSize? materialTapTargetSize,
- required Widget child}
Creates a button theme.
The textTheme
, minWidth
, height
, and colorScheme
arguments
must not be null.
Implementation
ButtonTheme({
super.key,
ButtonTextTheme textTheme = ButtonTextTheme.normal,
ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,
double minWidth = 88.0,
double height = 36.0,
EdgeInsetsGeometry? padding,
ShapeBorder? shape,
bool alignedDropdown = false,
Color? buttonColor,
Color? disabledColor,
Color? focusColor,
Color? hoverColor,
Color? highlightColor,
Color? splashColor,
ColorScheme? colorScheme,
MaterialTapTargetSize? materialTapTargetSize,
required super.child,
}) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0),
assert(height != null && height >= 0.0),
assert(alignedDropdown != null),
assert(layoutBehavior != null),
data = ButtonThemeData(
textTheme: textTheme,
minWidth: minWidth,
height: height,
padding: padding,
shape: shape,
alignedDropdown: alignedDropdown,
layoutBehavior: layoutBehavior,
buttonColor: buttonColor,
disabledColor: disabledColor,
focusColor: focusColor,
hoverColor: hoverColor,
highlightColor: highlightColor,
splashColor: splashColor,
colorScheme: colorScheme,
materialTapTargetSize: materialTapTargetSize,
);