In current Age, All mobile App have duel theme. Here we introduce change App theme dynamically. Theme change on button click.
You can Download Source Code via Github.
Implement theme
Light theme
static final ThemeData lightTheme = ThemeData(
primaryColor: UtilsImporter().colorUtils.primarycolor,
primaryColorLight: Colors.white,
primaryColorDark: Colors.black,
brightness: Brightness.light,
inputDecorationTheme: InputDecorationTheme(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: UtilsImporter().colorUtils.primarycolor))),
);
Dark theme
static final ThemeData darkTheme = ThemeData(
primaryColor: UtilsImporter().colorUtils.primarycolor,
primaryColorLight: Colors.black,
primaryColorDark: Colors.white,
brightness: Brightness.dark,
inputDecorationTheme: InputDecorationTheme(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: UtilsImporter().colorUtils.primarycolor))),
);
Change theme
onTap: () {
if (isDarkThemeMode == true) {
setState(() {
isDarkThemeMode = false;
});
_changeTheme(context, MyThemeKeys.LIGHT);
} else {
setState(() {
isDarkThemeMode = true;
});
_changeTheme(context, MyThemeKeys.DARK);
}
},
void _changeTheme(BuildContext buildContext, MyThemeKeys key) {
CustomTheme.instanceOf(buildContext).changeTheme(key);
}
You can Download Source Code via Github.
I got this web site from my friend who informed me
on the topic of this web page and at the moment this time
I am visiting this web site and reading very
informative articles or reviews here.
Great delivery. Solid arguments. Keep up the good work.
It’s very trouble-free to find out any matter on web as compared to textbooks, as I found this piece of writing at this web page.
Nice post. I learn something new and challenging on websites I stumbleupon everyday.
It’s always exciting to read articles from other writers and practice
something from other web sites.
Wow that was odd. I just wrote an extremely long comment but after
I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyhow, just wanted to
say superb blog!
Your means of describing everything in this article is really good, every one be capable of easily know
it, Thanks a lot.
Greate article. Keep posting such kind of info on your page.
Im really impressed by your blog.
Hello there, You have done an excellent job. I’ll certainly digg it
and individually recommend to my friends. I am sure they will be benefited from this website.
I don’t even know how I finished up here, but I thought this
post was once great. I do not realize who you are however certainly you are going to a famous blogger if you happen to
aren’t already. Cheers!
Hi mates, how is the whole thing, and what you want to say on the topic
of this paragraph, in my view its genuinely amazing for me.
I couldn’t resist commenting. Perfectly written!
Attractive section of content. I simply stumbled upon your
site and in accession capital to assert that I acquire in fact loved account your weblog posts.
Any way I’ll be subscribing in your augment or even I achievement you get right of entry to
constantly fast.
I haѵe read ѕo many content regarԁing the Ьⅼogger lovers buut this рaraցraph is
really a good paragгaph, keep iit up.
Neat blog! Is your theme custom made or did you download it from
somewhere? A design like yours with a few simple
adjustements would really make my blog shine.
Please let me know where you got your design. Many thanks
Hi i am kavin, itѕ my first ocсasi᧐n to commenting anyᴡherе, when i read thiѕ post i tһought i could also make comment due to thiѕ good post.
I cannot thank you enough for the blog.Really looking forward to read more. Want more.
Just that is necessary.
I think, that you are not right. Write to me in PM, we will talk.
Spot on with this write-up, I seriously think this web site needs a lot more
attention. I’ll probably be returning to read more, thanks for the advice!
It is remarkable, the helpful information