Flutter Tutorial | Flutter Change App Theme | Flutter Theme | How to change app theme in flutter |#4
Programming Guru
Flutter Tutorial - Flutter Change App Theme - Flutter Theme
Applies a theme to descendant widgets.
A theme describes the colors and typographic choices of an application.
Descendant widgets obtain the current theme's ThemeData object using Theme.of. When a widget uses Theme.of, it is automatically rebuilt if the theme later changes, so that the changes can be applied.
The Theme widget implies an IconTheme widget, set to the value of the ThemeData.iconTheme of the data for the Theme. ThemeData, which describes the actual configuration of a theme. AnimatedTheme, which animates the ThemeData when it changes rather than changing the theme all at once. MaterialApp, which includes an AnimatedTheme widget configured via the MaterialApp.theme argument.
Defines the configuration of the overall visual Theme for a MaterialApp or a widget subtree within the app.
The MaterialApp theme property can be used to configure the appearance of the entire app. Widget subtree's within an app can override the app's theme by including a Theme widget at the top of the subtree.
Widgets whose appearance should align with the overall theme can obtain the current theme's configuration with Theme.of. Material components typically depend exclusively on the colorScheme and textTheme. These properties are guaranteed to have non-null values.
The static Theme.of method finds the ThemeData value specified for the nearest BuildContext ancestor. This lookup is inexpensive, essentially just a single HashMap access. It can sometimes be a little confusing because Theme.of can not see a Theme widget that is defined in the current build method's context. To overcome that, create a new custom widget for the subtree that appears below the new Theme, or insert a widget that creates a new BuildContext, like Builder.
Follow my Facebook Page : https://www.facebook.com/105940115222549 Follow me on Instagram : https://www.instagram.com/p/CViUlw2sOMi Follow me on tumblr : http://programming-guru.tumblr.com Follow me on reddit : https://www.reddit.com/u/Programming_guru1?utm_medium=android_app&utm_source=share ... https://www.youtube.com/watch?v=LcQtEMDywgs
24405374 Bytes