-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
When I use Getx to manage multiple theme colors, I find that after switching themes, I need to rebuild all the pages related to the theme color, even when using Theme.of(context). This causes the page loading to be very slow. Are there any optimization ideas?
I discovered that when using Getx to switch themes, the underlying code calls the update() method. Could this be the root cause of the problem?
The version I'm using is ^5.0.0-release-candidate-9.3.2
void setTheme(ThemeData value) {
if (config.darkTheme == null) {
config = config.copyWith(theme: value);
} else {
if (value.brightness == Brightness.light) {
config = config.copyWith(theme: value);
} else {
config = config.copyWith(darkTheme: value);
}
}
update();
}Metadata
Metadata
Assignees
Labels
No labels