defaultZetaValues static method
- BuildContext context
Returns the default Zeta values; used if Zeta is not found in the widget tree.
Implementation
// ignore: prefer_constructors_over_static_methods
static Zeta defaultZetaValues(BuildContext context) {
// Try to get the brightness from the closest MaterialApp theme
Brightness brightness;
try {
brightness = Theme.of(context).brightness;
} catch (_) {
// If we can't find a MaterialApp theme, use the platform brightness
brightness = MediaQuery.platformBrightnessOf(context);
}
// Create a default Zeta with the determined brightness
return Zeta(
themeMode: brightness == Brightness.dark ? ThemeMode.dark : ThemeMode.light,
child: const SizedBox(), // Empty widget as we're just creating defaults
);
}