September 2019
Beginner
512 pages
12h 52m
English
Styling widgets in Flutter can be done in a few ways, and everything related to styles is based on a Theme widget. It is time to check out how this works. Let's say, for example, that we have a simple app, as follows:
class MyAppDefaultTheme extends StatelessWidget { @override Widget build(BuildContext context) { return Container( color: Colors.red, child: Center( child: Text( "Simple Text", textDirection: TextDirection.ltr, ), ), ); }}
As you can see, we are just using a Container widget as our root widget without a Theme widget. So, we can assume we do not have any styles applied to its descendant widgets. Also, the textDirection property is new at this point. When using the MaterialApp widget in our layout, it provides ...
Read now
Unlock full access