changePrimaryColor method Null safety

void changePrimaryColor(
  1. Color? color
)

Implementation

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