isDarkMode function

bool isDarkMode([
  1. BuildContext? context
])

Implementation

bool isDarkMode([BuildContext? context]) {
  if (context != null) {
    return Theme.of(context).brightness == Brightness.dark;
  }
  return PlatformDispatcher.instance.platformBrightness == Brightness.dark;
}