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.
Flutter
Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.
See the getting started guide for information about using Flutter.