getBrightness static method
Gets the brightness (light/dark mode) from the theme.
Uses the CupertinoTheme brightness when one is set. Under a MaterialApp that is the Material theme's brightness. When the theme sets none (a CupertinoApp following the system), falls back to the platform brightness.
Implementation
static Brightness getBrightness(BuildContext context) =>
CupertinoTheme.brightnessOf(context);