Fixes bug with following/unfollowing system theme

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2025-04-28 14:31:52 +02:00
parent e402308f7b
commit bfa5c646d7
4 changed files with 30 additions and 53 deletions
@@ -0,0 +1,23 @@
import "package:flutter/material.dart";
class ArcaneTheme extends InheritedWidget {
final ThemeMode themeMode;
final bool followSystem;
const ArcaneTheme({
required this.themeMode,
required this.followSystem,
required super.child,
super.key,
});
static ArcaneTheme? of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<ArcaneTheme>();
}
@override
bool updateShouldNotify(ArcaneTheme oldWidget) {
return themeMode != oldWidget.themeMode ||
followSystem != oldWidget.followSystem;
}
}