flutter-packages
flutter-packages copied to clipboard
Listen to platform color changes
Reading from macOS and Windows color accents happened on material-foundation/material-dynamic-color-flutter#42 and material-foundation/material-dynamic-color-flutter#43 and they work fine but they aren't responsive to OS changes. There are ways to get notified about OS changes and update colorings:
- Windows https://github.com/flutter/engine/pull/28131/files#diff-216c47499300810cf6eed53eca4e9cfe09aefa5b8c96b85f5a93e5caf3557378R61-R64
WM_DWMCOLORIZATIONCOLORCHANGED
see also https://stackoverflow.com/q/65155419 - macOS https://github.com/flutter/engine/blob/2321e302428ffc0904e5f0050910511438e11de2/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm#L535-L555
What do you suggest here, to reimplement the logic here, or, make flutter engine to take those into account among their other offerings such as whether system is in dark mode. And how the Android one works, listening for onResume to reread from the platform?