copyWith method

MBInAppMessageTheme copyWith({
  1. Color? backgroundColor,
  2. TextStyle? titleStyle,
  3. TextStyle? bodyStyle,
  4. Color? closeButtonColor,
  5. Color? closeButtonBackgroundColor,
  6. Color? button1BackgroundColor,
  7. TextStyle? button1TextStyle,
  8. double? button1BorderRadius,
  9. Color? button2BackgroundColor,
  10. Color? button2BorderColor,
  11. TextStyle? button2TextStyle,
  12. double? button2BorderRadius,
})

Creates a copy of this theme but with the given fields replaced with the new values

Implementation

MBInAppMessageTheme copyWith({
  Color? backgroundColor,
  TextStyle? titleStyle,
  TextStyle? bodyStyle,
  Color? closeButtonColor,
  Color? closeButtonBackgroundColor,
  Color? button1BackgroundColor,
  TextStyle? button1TextStyle,
  double? button1BorderRadius,
  Color? button2BackgroundColor,
  Color? button2BorderColor,
  TextStyle? button2TextStyle,
  double? button2BorderRadius,
}) {
  return MBInAppMessageTheme(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    titleStyle: titleStyle ?? this.titleStyle,
    bodyStyle: bodyStyle ?? this.bodyStyle,
    closeButtonColor: closeButtonColor ?? this.closeButtonColor,
    closeButtonBackgroundColor:
        closeButtonBackgroundColor ?? this.closeButtonBackgroundColor,
    button1BackgroundColor:
        button1BackgroundColor ?? this.button1BackgroundColor,
    button1TextStyle: button1TextStyle ?? this.button1TextStyle,
    button1BorderRadius: button1BorderRadius ?? this.button1BorderRadius,
    button2BackgroundColor:
        button2BackgroundColor ?? this.button2BackgroundColor,
    button2BorderColor: button2BorderColor ?? this.button2BorderColor,
    button2TextStyle: button2TextStyle ?? this.button2TextStyle,
    button2BorderRadius: button2BorderRadius ?? this.button2BorderRadius,
  );
}