darkTheme property Null safety
final
The ThemeData to use when a 'dark mode' is requested by the system.
Some host platforms allow the users to select a system-wide 'dark mode', or the application may want to offer the user the ability to choose a dark theme just for this application. This is theme that will be used for such cases. themeMode will control which theme will be used.
This theme should have a ThemeData.brightness set to Brightness.dark.
Uses theme instead when null. Defaults to the value of ThemeData.light() when both darkTheme and theme are null.
See also:
- themeMode, which controls which theme to use.
- MediaQueryData.platformBrightness, which indicates the platform's desired brightness and is used to automatically toggle between theme and darkTheme in MaterialApp.
- ThemeData.brightness, which is typically set to the value of MediaQueryData.platformBrightness.
Implementation
final ThemeData? darkTheme;