mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Adds boolean convenience getters (`isDark`, `isLight`, `isSystem`) to
`ThemeMode`.
This change improves readability and ergonomics when branching on
`ThemeMode` values by
providing named, self-documenting getters instead of repeated equality
checks
(e.g. `themeMode == ThemeMode.dark`). The addition is non-breaking and
does not
change any existing behavior.
Example:
Before:
if (themeMode == ThemeMode.dark) {
...
}
After:
if (themeMode.isDark) {
...
}
No tests were added as this change introduces simple enum getters with
no logic
beyond value comparison and does not alter runtime behavior.