setTheme method Null safety

void setTheme(
  1. ThemeData value
)

Implementation

void setTheme(ThemeData value) {
  if (darkTheme == null) {
    theme = value;
  } else {
    if (value.brightness == Brightness.light) {
      theme = value;
    } else {
      darkTheme = value;
    }
  }
  update();
}