copyWith method
CardImageTheme
copyWith({
- ValueGetter<
AbstractButtonStyle?> ? style, - ValueGetter<
Axis?> ? direction, - ValueGetter<
double?> ? hoverScale, - ValueGetter<
double?> ? normalScale, - ValueGetter<
Color?> ? backgroundColor, - ValueGetter<
Color?> ? borderColor, - ValueGetter<
double?> ? gap,
Creates a copy of this theme with optionally overridden properties.
Uses ValueGetter functions to allow nullable overrides.
Example:
final newTheme = existingTheme.copyWith(
hoverScale: () => 1.2,
backgroundColor: () => Colors.blue.shade50,
);
Implementation
CardImageTheme copyWith({
ValueGetter<AbstractButtonStyle?>? style,
ValueGetter<Axis?>? direction,
ValueGetter<double?>? hoverScale,
ValueGetter<double?>? normalScale,
ValueGetter<Color?>? backgroundColor,
ValueGetter<Color?>? borderColor,
ValueGetter<double?>? gap,
}) {
return CardImageTheme(
style: style == null ? this.style : style(),
direction: direction == null ? this.direction : direction(),
hoverScale: hoverScale == null ? this.hoverScale : hoverScale(),
normalScale: normalScale == null ? this.normalScale : normalScale(),
backgroundColor:
backgroundColor == null ? this.backgroundColor : backgroundColor(),
borderColor: borderColor == null ? this.borderColor : borderColor(),
gap: gap == null ? this.gap : gap(),
);
}