applyTheme method

  1. @override
void applyTheme(
  1. GeneratedPalette palette
)
override

Apply colors from a GeneratedPalette to this component's state.

This method is called when the theme changes or when a new palette is generated. It should update all color properties based on the palette's values.

Implementation should use ThemeColorMapper.forComponent() for component-specific color resolution.

Implementation

@override
void applyTheme(GeneratedPalette palette) {
  super.applyTheme(palette);

  final colors = ThemeColorMapper.forComponent(palette, componentName);

  // Title colors (primary text)
  titleColorLight = colors.restTextColorLight;
  titleColorDark = colors.restTextColorDark;

  // Message colors (secondary text)
  messageColorLight = colors.restIconColorLight;
  messageColorDark = colors.restIconColorDark;

  // Confirm button uses accent color
  confirmColorLight = colors.accentColorLight;
  confirmColorDark = colors.accentColorDark;

  // Cancel button uses secondary text color
  cancelColorLight = colors.restIconColorLight;
  cancelColorDark = colors.restIconColorDark;
}