mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
6764d8074a
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
27 lines
647 B
Dart
27 lines
647 B
Dart
import "package:flutter/material.dart";
|
|
|
|
class ArcaneTheme extends InheritedWidget {
|
|
final ThemeMode themeMode;
|
|
final bool followSystem;
|
|
final ThemeData? theme;
|
|
|
|
const ArcaneTheme({
|
|
required super.child,
|
|
this.themeMode = ThemeMode.light,
|
|
this.followSystem = false,
|
|
this.theme,
|
|
super.key,
|
|
});
|
|
|
|
static ArcaneTheme? of(BuildContext context) {
|
|
return context.dependOnInheritedWidgetOfExactType<ArcaneTheme>();
|
|
}
|
|
|
|
@override
|
|
bool updateShouldNotify(ArcaneTheme oldWidget) {
|
|
return themeMode != oldWidget.themeMode ||
|
|
followSystem != oldWidget.followSystem ||
|
|
theme != oldWidget.theme;
|
|
}
|
|
}
|