color property

Retrieve the color scheme.

New themes can be defined by extending ColorThemeData.

カラースキームを取得します。

ColorThemeDataをエクステンションすることで新しいテーマを定義することが可能です。

See also:

Implementation

ColorThemeData get color {
  switch (themeMode) {
    case ThemeMode.dark:
      return _darkColor;
    case ThemeMode.light:
      return _lightColor;
    case ThemeMode.system:
      final brightness =
          WidgetsBinding.instance.platformDispatcher.platformBrightness;
      if (brightness == Brightness.dark) {
        return _darkColor;
      } else {
        return _lightColor;
      }
  }
}