systemTheme method

  1. @override
ThemeBase systemTheme()
override

Returns the system theme (light or dark).

Implementation

@override
ThemeBase systemTheme() {
  final theme = ui.PlatformDispatcher.instance.platformBrightness == ui.Brightness.light
      ? getThemes().firstWhere((element) => element.name == 'Light')
      : getThemes().firstWhere((element) => element.name == 'Dark');

  return theme.copyWith(
    name: 'System',
    icon: Icons.brightness_auto,
  );
}