macos_ui
macos_ui copied to clipboard
MacosThemeData should implement value equality
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
See https://github.com/superlistapp/super_editor/issues/1568
Alright, first of all, excuse the delay. All maintainers suffer from rather low bandwidth right now.
I’d like to notify you that I have received your issue and will try to allocate some time to address it.