kherel / animated_theme_switcher

Flutter animated theme switcher
https://pub.dev/packages/animated_theme_switcher
MIT License
278 stars 28 forks source link

When closing the application, the theme is not saved #41

Closed Kerabor closed 2 years ago

Kerabor commented 2 years ago

What should I prescribe so that the theme is saved when exiting the application?

EngFoggy commented 2 years ago

Honestly I don't think this package is actually in charge of doing that. You can use SharedPreferences to save a variable that lets you identify the applied theme, and read it before initializing ThemeProvider.

Kerabor commented 2 years ago

Честно говоря, я не думаю, что этот пакет действительно отвечает за это. Вы можете использовать SharedPreferences для сохранения переменной, которая позволяет идентифицировать примененную тему и читать ее перед инициализацией ThemeProvider.

I tried it. I can't ... the application does not start stupidly

kherel commented 2 years ago

What should I prescribe so that the theme is saved when exiting the application?

The package is only responsible for animation, and does not imply saving current theme. But check the extra example...