Closed Sandai64 closed 2 years ago
I have the same error, any solution ?
same problem
Same here, anyone got a fix?
I have released a fix for system theme change not being detected. Please try v2.3.1
and if this issue is fixed.
I have release a fix for system theme change not being detected. Please try
v2.3.1
and if this issue is fixed.
same issue, app theme doesn't update if app is started while the system was in dark mode. only work when the app is started while system not in dark mode
That's strange. I also do have Oneplus Nord CE with Android 11 and when I start my app while system is in dart mode, it works fine for me.
Checkout this part of the docs where the mode is retrieved from storage before loading the app. Maybe this can fix your issue but I am not sure.
To help me reproduce this, could you please create an example app with the same issue and provide exact steps to reproduce? (like does it happen on first run or second run?) At least post the exact code here.
That's strange. I also do have Oneplus Nord CE with Android 11 and when I start my app while system is in dart mode, it works fine for me.
Checkout this part of the docs where the mode is retrieved from storage before loading the app. Maybe this can fix your issue but I am not sure.
To help me reproduce this, could you please create an example app with the same issue and provide exact steps to reproduce? (like does it happen on first run or second run?) At least post the exact code here.
yes you are right, i think there is something wrong in my project, because when i create new project and using the same ThemeData
that i used in my project, it worked fine
@gnassro I thought so. Please check your configuration and make sure you're not changing theme explicitly from somewhere.
@erwangse Does the latest release work for you?
@gnassro I thought so. Please check your configuration and make sure you're not changing theme explicitly from somewhere.
I discovered that the problem because of using this package https://pub.dev/packages/preload_page_view. when i replace it with the default Widget, it work fine
@gnassro Ah! I think that package caches widgets so those widgets are not updated when the theme is changed. Although this is not a solution, can you try setting the preloadPagesCount
to 0
(if allowed) just to check if that works as widgets shouldn't be cached in that case.
@gnassro Ah! I think that package caches widgets so those widgets are not updated when the theme is changed. Although this is not a solution, can you try setting the
preloadPagesCount
to0
(if allowed) just to check if that works as widgets shouldn't be cached in that case.
@BirjuVachhani i tried, but same issue, i think i need to change this package. thanks
Closing this issue as it seems to be fixed. Feel free to reopen if it does work for some reason.
Hi there, just wanted to make a quick follow-up and add a bit of context to this ! I'm the (currently) sole developer of a flutter app in my company, sorry I didn't respond in time. As for your first concern, I do cache theme changes in Hive & restore them on startup. And as for your second, the new release seems to work just fine ! Thanks ! :+1:
Describe the bug App theme doesn't update if the app is started while the system was in dark mode. I have only tested this on an Android 11 phone, the Oneplus Nord.
The code
Environment
Additional info
I've noticed that, if I change the system from light/dark mode when the theme isn't updating, I don't even get a log message in my
flutter run
session. I do get logs notifying a theme change when I start the app when the system is in light mode, however.So far I don't know if the issue is with my code or your package, I'll be very grateful if you could help me on this.
Note that the issue appears regardless if the app is in release or debug mode.