copyWith method

MonetThemeData copyWith({
  1. Palette? primary,
  2. Palette? secondary,
  3. Palette? tertiary,
  4. Algo? algo,
  5. ColorModel? colorModel,
  6. double? backgroundTone,
  7. Brightness? brightness,
  8. double? contrast,
  9. double? scale,
  10. MonetShapeTheme? shapeTheme,
  11. Typography typography(
    1. ColorScheme
    )?,
  12. bool? compactLineHeights,
  13. double? lineHeightClearance,
})

Copies theme fields and palette values verbatim. Policy fields do not re-solve arbitrary Palette adapters; when changing background tone, contrast, algorithm, or model for a logical endpoint, also supply palettes constructed with those inputs. Motion frames intentionally rely on this.

Implementation

MonetThemeData copyWith({
  Palette? primary,
  Palette? secondary,
  Palette? tertiary,
  Algo? algo,
  ColorModel? colorModel,
  double? backgroundTone,
  Brightness? brightness,
  double? contrast,
  double? scale,
  MonetShapeTheme? shapeTheme,
  Typography Function(ColorScheme)? typography,
  bool? compactLineHeights,
  double? lineHeightClearance,
}) {
  return MonetThemeData(
    primary: primary ?? this.primary,
    secondary: secondary ?? this.secondary,
    tertiary: tertiary ?? this.tertiary,
    algo: algo ?? this.algo,
    colorModel: colorModel ?? this.colorModel,
    backgroundTone: backgroundTone ?? this.backgroundTone,
    brightness: brightness ?? this.brightness,
    contrast: contrast ?? this.contrast,
    scale: scale ?? this.scale,
    shapeTheme: shapeTheme ?? this.shapeTheme,
    typography: typography ?? this.typography,
    compactLineHeights: compactLineHeights ?? this.compactLineHeights,
    lineHeightClearance: lineHeightClearance ?? this.lineHeightClearance,
  );
}