getColor method Null safety

Color getColor(
  1. 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;
  }
}