isDarkTheme function
First checks PlatformTheme
then falls back to MediaQuery
Implementation
bool isDarkTheme(BuildContext context) =>
PlatformTheme.of(context)?.isDark ??
(MediaQuery.of(context).platformBrightness == Brightness.dark);
First checks PlatformTheme
then falls back to MediaQuery
bool isDarkTheme(BuildContext context) =>
PlatformTheme.of(context)?.isDark ??
(MediaQuery.of(context).platformBrightness == Brightness.dark);