changeAccentColor method Null safety

void changeAccentColor(
  1. Color? color
)

Implementation

void changeAccentColor(Color? color) {
  final newDarkTheme = darkTheme.copyWith(accentColor: color);
  final newLightTheme = lightTheme.copyWith(accentColor: color);
  darkTheme = newDarkTheme;
  lightTheme = newLightTheme;
  notifyListeners();
}