kdsuneraavinash / theme_provider

Easy to use, customizable and pluggable Theme Provider.
https://pub.dartlang.org/packages/theme_provider
MIT License
153 stars 28 forks source link

Use Default System theme when the app launches for the first time #12

Closed vinoopks closed 3 years ago

vinoopks commented 4 years ago

Thanks for this package . This really helps! I would love to have a feature, taking the system default theme mode when the app launches for the first time.

kdsuneraavinash commented 4 years ago

I think I wanted to implement this before but there was a small problem.

Let's say you put 2 themes; blue-colored and red-colored. So which one is the default dark theme and the light theme? So, to implement this, we have to provide two parameters on which will be the default dark theme and the default light theme. (And fallback to not using the default sys theme when neither is given) So, there can be several edge cases around this issue.

Pull requests are welcome though :)

vinoopks commented 4 years ago

@kdsuneraavinash As a workaround, we can still have the feature giving conditions in onInitCallback of the ThemeProvider. And for most of the business use cases, would normally be having a default light and dark theme. So, it might be a good idea to implement something. Thanks , will create a pull request, when I have a solid solution.

kdsuneraavinash commented 4 years ago

Yes, that would be great.