Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In flutter 3.10 AdaptiveThemeMode.system won't work as it should be. #46

Closed
YonasAlem opened this issue May 15, 2023 · 5 comments
Closed

Comments

@YonasAlem
Copy link

YonasAlem commented May 15, 2023

Describe the bug
When the theme mode is AdaptiveThemeMode.system and the current phone's system theme is dark mode and when you launch the app it will display the dark theme. but while the app is opened and when you change the the phone's system theme to light mode the app will not reflect to the change. but after restart it will change to light mode.

but vice versa is still working fines, when you launch the app from light mode.

before flutter 3.10 it works as it should.

To Reproduce
Steps to reproduce the behavior:

  1. make sure AdaptiveThemeMode.system is applied.
  2. if the app is opened close it.
  3. change the system theme to dark mode
  4. launch the app
  5. we will see the dark mode applied to the app
  6. change the systems theme to light mode while the app is opened.
  7. the UI won't change to light.
  8. but if I restart the app, the light mode will be applied.

Expected behavior
when changing the systems theme from dark to light, the app should also react to that.

Screenshots
No need.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Samsung galaxy a12 - real device

Additional context
Add any other context about the problem here.

@BirjuVachhani
Copy link
Owner

Thank you @YonasAlem for reporting this issue. Would you also provide some additional info like what device and OS were you able to reproduce this on? was it a simulator or a real device?

@YonasAlem
Copy link
Author

YonasAlem commented May 15, 2023 via email

@BirjuVachhani
Copy link
Owner

@YonasAlem So I have dart theme enabled in system and adaptiveThemeMode.system selected in the app. I go to settings and tun off dark theme and then go back to the app and the app is in light theme now as expected. Am I doing anything wrong? Can you try to reproduce with the example app please?

untitled.mp4

@YonasAlem
Copy link
Author

YonasAlem commented May 28, 2023

@BirjuVachhani I'm sorry for the delay. I found out that the problem was not in your package, instead it was another package called #flutter_screenutil. and they fixed it. and its all working now. sorry for misleading info on your package. thanks for your time.

@BirjuVachhani
Copy link
Owner

@YonasAlem No problem! Glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants