Mouad Debbar d5751be500
High contrast color scheme based on system forced colors (#165068)
This PR introduces a `bool useSystemColors` parameter to the `ThemeData`
constructor.

The goal from this PR is to enable users to easily create high contrast
themes that are based on system colors for their `MaterialApp`:

```dart
MaterialApp(
  theme: ThemeData.light(),
  darkTheme: ThemeData.dark(),
  highContrastTheme: ThemeData(useSystemColors: true, ...),
  highContrastDarkTheme: ThemeData(useSystemColors: true, ...),
)
```
The `MaterialApp` widget will automatically pick the correct one of the
4 themes based on system settings (light/dark mode, high contrast
enabled/disabled).

Depends on https://github.com/flutter/flutter/pull/164933
Closes https://github.com/flutter/flutter/issues/118853
2025-03-26 19:25:07 +00:00
..