Member-only story
Reacting to Windows Settings Change in a Flutter Desktop App
Dynamically theme your Flutter Windows App using Event Channels to receive events
Synopsis: Learn how to set a WNDPROC
callback function from Flutter using Platform Channels in a Plugin. The example shows how to dynamically change the Theme in your App.
Introduction
Two months ago Flutter 2.10 brought stable Windows support. Ok, this wasn’t news, Flutter compiled applications for Windows before, why is it so important now? The answer is a simple word: “stable”, cause now Google declared it is, we can decide to invest more of our time and resources in developing Apps for Windows using this fantastic tool.
Thanks to the work of several enthusiastic people, a lot of packages on pub.dev support Windows development, and the list is growing. However, as told before, designing our shiny new Windows App in Flutter sometimes there could be something that we miss.
For example, we could need that our App should react to Windows system-wide events, and change its behavior accordingly. Flutter doesn’t have a ready-made interface for doing this. To learn how it can be made we will implement an Event Channel that can make these events available in our Dart code.