copyWith method

TrackerTheme copyWith({
  1. ValueGetter<double?>? radius,
  2. ValueGetter<double?>? gap,
  3. 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(),
  );
}