-
-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The MacosThemeData class does not implement value equality as ThemeData from the Material package does.
This causes _InheritedMacosTheme.updateShouldNotify to return true on every widget tree rebuild if, for example, the light theme and dark theme are instantiated the way they are in the MacosUI sample project.
class _InheritedMacosTheme extends InheritedWidget {
// ignore: use_super_parameters
const _InheritedMacosTheme({
Key? key,
required this.theme,
required super.child,
}) : super(key: key);
final MacosTheme theme;
/// Will always return true when MacosThemeData objects are instantiated inline in MyApp example below
@override
bool updateShouldNotify(_InheritedMacosTheme old) =>
theme.data != old.theme.data;
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MacosApp(
theme: MacosThemeData.light(),
darkTheme: MacosThemeData.dark(),
themeMode: ThemeMode.system,
);
}
}
Steps To Reproduce
Adrian-Samoticha
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working