copyWith method
TrackerTheme
copyWith({
- ValueGetter<
double?> ? radius, - ValueGetter<
double?> ? gap, - ValueGetter<
double?> ? itemHeight,
Creates a copy of this theme with the given values replaced.
Returns a new TrackerTheme instance with the same values as this theme, except for any parameters that are explicitly provided. Use ValueGetter functions to specify new values.
Example:
final newTheme = originalTheme.copyWith(
radius: () => 16.0,
itemHeight: () => 56.0,
);
Implementation
TrackerTheme copyWith({
ValueGetter<double?>? radius,
ValueGetter<double?>? gap,
ValueGetter<double?>? itemHeight,
}) {
return TrackerTheme(
radius: radius == null ? this.radius : radius(),
gap: gap == null ? this.gap : gap(),
itemHeight: itemHeight == null ? this.itemHeight : itemHeight(),
);
}