Back to Blog
Flutter app builder online6/13/2023 ![]() Create a customized AppTheme class, with the specific properties you need for your theme.To meet this requirement, we use a fairly simple architecture: We would be fighting the framework the entire time, forced to inject colors all over the place, and inevitably running up against hard-coded defaults we could not reach. We can’t simply create our own custom theme, as so many of the core components of Flutter are Material based. While ColorScheme is a nice distillation of the elements of a Material Design Theme, what if you want to implement your own custom theme? Maybe you want two background colors, instead of Material’s one, or three accents, instead of two, ColorScheme alone will not really help you achieve this. To presumably help ease this pain, the Flutter team has introduced the ColorScheme class which condenses the above properties, into 13 colors. We’ll take a look at a technique that we use to implement custom app-specific themes, while still providing Material ThemeData to the core Flutter components. Last week we looked at how you can easily implement TextStyling, and this week we’re going to dive into Color Themes. There is a lot to like about Flutter, but one area I’m sure no one loves, is taming the Material Theme system! With over 65(!) properties, some of which, like TextTheme, break out into 10 more sub-properties is enough to make you go crazy pretty quick.
0 Comments
Read More
Leave a Reply. |