brightness property

Brightness? brightness
final

Explicit brightness override for all glass widgets under this theme.

When non-null, all glass widgets in this subtree render at this fixed brightness, regardless of the device OS setting, Material ThemeMode, or Cupertino theme brightness.

This is the highest-priority level in the four-level brightness cascade: GlassThemeData.brightness → Cupertino pin → Material ThemeMode → system.

Use cases

  • Force a specific section of your UI to always render in light mode (e.g. a camera viewfinder overlay that should always be dark).
  • Testing: pin brightness to a known value in widget tests.

When null (default), brightness resolves automatically through the cascade. See GlassTheme.brightnessOf for the resolution logic.

Implementation

final Brightness? brightness;