changeAccentColor method

void changeAccentColor(
  1. Color? color
)

Implementation

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