getColor method Null safety
- BuildContext context
Returns the appropriate Color for the current Brightness in theme
for context
.
Implementation
Color getColor(BuildContext context) {
switch (Theme.of(context).brightness) {
case Brightness.light:
return _light;
case Brightness.dark:
return _dark;
}
}