copyWith static method

Widget copyWith({
  1. Key? key,
  2. required Widget child,
  3. Axis? axis,
  4. IconThemeData? iconThemeData,
  5. double? itemSpacing,
  6. double? filledSpacing,
  7. double? height,
  8. double? minWidth,
  9. TextStyle? textStyle,
  10. Color? disabledColor,
  11. Color? color,
  12. Color? focusColor,
  13. Color? hoverColor,
  14. Color? highlightColor,
  15. Color? background,
  16. Color? focusBackground,
  17. Color? hoverBackground,
  18. Color? highlightBackground,
  19. Color? foreground,
  20. Color? hoverForeground,
  21. Color? highlightForeground,
  22. 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,
    ),
  );
}