Flutter Material App Widget | Material App Widget in Flutter | Flutter Tutorial | #2
Programming Guru
Flutter Material App Widget Material App Widget is a predefined class in a flutter. It is likely the main or core component of flutter. We can access all the other components and widgets provided by Flutter SDK. Text widget, Drop down button widget, AppBar widget, Scaffold widget, ListView widget, StatelessWidget, StatefulWidget, IconButton widget, TextField widget, Padding widget, ThemeData widget, etc. are the widgets that can be accessed using Material App Widget. There are many more widgets that are accessed using Material App widget. Using this widget, we can make an attractive app.
#Flutter #MaterialApp #Tutorial #beginners #FlutterTutorial
The Material App widget provides a ton of benefits that effect its entire widget subtree. This section is the beginning of our discussion of many widgets that provide helpful functionality for free.
Material App widget is an extension of the generic top-level widget provided by Flutter: Widgets App. Widgets App is a convenience widget that abstracts away a number of features required for most mobile apps, such as setting up a navigator and using an app-wide theme. Widgets App is completely customizable and makes no assumptions about default configuration, style, or how the UI of your app is structured. So, while it abstracts away some difficult pieces of functionality in your app, it requires more work to set up than Material App widget or Cupertino App. In this book, I won’t worry about Widgets App, because it’s a base class for the other two and rarely used directly by the developer.
Material App widget is even more convenient than Widgets App. It adds Material Design-specific functionality and styling options to your app. It doesn’t just help set up the Navigator, it does it for you. If you use the Material app widget, you don’t have to worry about implementing the animations that happen when a user navigates between pages: the widget takes care of that for you. It also allows you to use widgets that are specifically in the Material widgets collection, and there are plenty of those.
It’s called a Material app widget because it leans on Material style guidelines.[1] For example, page animations from one route to another are designed as you’d expect on an Android device. And all of the widgets in the Material widget library have that standard Google look and feel. This can be a concern if you have a specific design system that isn’t similar to Material, but there is no drawback to using Material App widget, even if you don’t want to use Material Design guidelines. Your theme is still fully customizable. (In fact, the example app you’ll build doesn’t look very “Material” at all. That’s on purpose, to drive this point home.) You can overwrite routing animations, and you don’t have to use the widgets in the Material library. The Material App widget provides quite a bit of convenience, but everything is reversible.
In the weather app, the Material App widget is used in the build method of the MyApp widget. This is the convention used in every Flutter app. Here’s the code in the main.dart file in the app, showing the main function again, as well as the root widget.
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=j5ESIFqVF4s
10956943 Bytes