changeBrightness method Null safety

void changeBrightness(
  1. Brightness value
)

Implementation

void changeBrightness(Brightness value) {
  final newThemeMode = value == Brightness.dark ? ThemeMode.dark : ThemeMode.light;
  if (_themeMode == newThemeMode) {
    return;
  }
  _themeMode = newThemeMode;
  notifyListeners();
}