The toggle changed _mode and called setState on StudioAppState, but the sidebar that hosts the toggle button never rebuilt: StudioApp returns `MaterialApp(home: const StudioShell())`, and the const child's element doesn't get a didUpdateWidget on parent rebuild. So the toggle's icon would only flip on the next health-poll tick (up to 5s later) when the sidebar's own setState fired for an unrelated reason. Switch to a ValueNotifier-based pattern: - StudioAppState exposes `modeNotifier` (ValueNotifier<...>) instead of a getter. - StudioApp wraps MaterialApp in a ValueListenableBuilder bound to the notifier so themeMode flips immediately. - _ThemeToggle is itself a ValueListenableBuilder against the same notifier — its icon and onPressed always reflect the current value without depending on parent rebuild timing. Bumps fai_studio 0.7.2 -> 0.7.3. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com> |
||
|---|---|---|
| .. | ||
| data | ||
| pages | ||
| theme | ||
| widgets | ||
| main.dart | ||