copyWith static method
Widget
copyWith({
- Key? key,
- required Widget child,
- Axis? axis,
- IconThemeData? iconThemeData,
- double? itemSpacing,
- double? filledSpacing,
- double? height,
- double? minWidth,
- TextStyle? textStyle,
- Color? disabledColor,
- Color? color,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? background,
- Color? focusBackground,
- Color? hoverBackground,
- Color? highlightBackground,
- Color? foreground,
- Color? hoverForeground,
- Color? highlightForeground,
- Duration? animationDuration,
Makes a copy of the nearest ButtonTheme overwriting selected fields.
Implementation
static Widget copyWith({
Key? key,
required Widget child,
Axis? axis,
IconThemeData? iconThemeData,
double? itemSpacing,
double? filledSpacing,
double? height,
double? minWidth,
TextStyle? textStyle,
Color? disabledColor,
Color? color,
Color? focusColor,
Color? hoverColor,
Color? highlightColor,
Color? background,
Color? focusBackground,
Color? hoverBackground,
Color? highlightBackground,
Color? foreground,
Color? hoverForeground,
Color? highlightForeground,
Duration? animationDuration,
}) {
return Builder(
key: key,
builder: (context) => ButtonTheme(
data: ButtonTheme.of(context).copyWith(
axis: axis,
iconThemeData: iconThemeData,
itemSpacing: itemSpacing,
filledSpacing: filledSpacing,
height: height,
minWidth: minWidth,
textStyle: textStyle,
disabledColor: disabledColor,
color: color,
focusColor: focusColor,
hoverColor: hoverColor,
highlightColor: highlightColor,
background: background,
focusBackground: focusBackground,
hoverBackground: hoverBackground,
highlightBackground: highlightBackground,
foreground: foreground,
hoverForeground: hoverForeground,
highlightForeground: highlightForeground,
animationDuration: animationDuration,
),
child: child,
),
);
}