copyWith static method

Widget copyWith({
  1. Key? key,
  2. required Widget child,
  3. TextStyle? textStyle,
  4. TextStyle? titleTextStyle,
  5. EdgeInsets? titlePadding,
  6. EdgeInsets? padding,
  7. Color? highlightColor,
  8. Color? backgroundColor,
  9. double? itemSpacing,
  10. Color? infoColor,
  11. Color? errorColor,
  12. Color? warningColor,
  13. Color? successColor,
  14. Curve? animationCurve,
  15. Duration? duration,
  16. Duration? animationDuration,
})

Makes a copy of the nearest MessageTheme overwriting selected fields.

Implementation

static Widget copyWith({
  Key? key,
  required Widget child,
  TextStyle? textStyle,
  TextStyle? titleTextStyle,
  EdgeInsets? titlePadding,
  EdgeInsets? padding,
  Color? highlightColor,
  Color? backgroundColor,
  double? itemSpacing,
  Color? infoColor,
  Color? errorColor,
  Color? warningColor,
  Color? successColor,
  Curve? animationCurve,
  Duration? duration,
  Duration? animationDuration,
}) {
  return Builder(
    key: key,
    builder: (context) => MessageTheme(
      data: MessageTheme.of(context).copyWith(
        textStyle: textStyle,
        titleTextStyle: titleTextStyle,
        titlePadding: titlePadding,
        padding: padding,
        highlightColor: highlightColor,
        backgroundColor: backgroundColor,
        itemSpacing: itemSpacing,
        infoColor: infoColor,
        errorColor: errorColor,
        warningColor: warningColor,
        successColor: successColor,
        animationCurve: animationCurve,
        duration: duration,
        animationDuration: animationDuration,
      ),
      child: child,
    ),
  );
}