isDarkMode static method

bool isDarkMode(
  1. BuildContext context
)

Check if the current theme is dark mode.

Implementation

static bool isDarkMode(BuildContext context) {
  return Theme.of(context).brightness == Brightness.dark;
}