I have two screens, where
First: Listing of data from Firebase
Second: Add data in that screen so I want to comeback to first screen, Everything working fine only there was a black screen when I go back. Now issue was gone, I have searched for how it works but its still not clear my concept about this, Can any one describe how it works?
Before:
return new MaterialApp( title: "AddEditNames ", home: new AddEditNameScreen(), );
After: when i have replaced it by
return new Scaffold( backgroundColor: Color.fromRGBO(30, 30, 30, 1.0), body: new AddEditNameScreen(), appBar: new AppBar( elevation: 0.0, backgroundColor: Colors.blueAccent, actions: <Widget>[ ], title: new Text( "AddEditNames", style: new TextStyle(color: Colors.white), ), centerTitle: true, ), );
MaterialApp is the starting point of your app, it tells Flutter that you are going to use Material components and follow material design in your app. Scaffold is used under MaterialApp , it gives you many basic functionalities, like AppBar , BottomNavigationBar , Drawer , FloatingActionButton etc.
MaterialApp Class: MaterialApp 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.
MaterialApp is a widget that introduces many interesting tools such as Navigator or Theme to help you develop your app. Material is, on the other hand, a widget used to define a UI element respecting Material rules. It defines what elevation is, shape, and stuff.
The Scaffold is a widget in Flutter used to implements the basic material design visual layout structure. It is quick enough to create a general-purpose mobile application and contains almost everything we need to create a functional and responsive Flutter apps. This widget is able to occupy the whole device screen.
MaterialApp
is the starting point of your app, it tells Flutter that you are going to use Material components and follow material design in your app.
Scaffold
is used under MaterialApp
, it gives you many basic functionalities, like AppBar
, BottomNavigationBar
, Drawer
, FloatingActionButton
etc.
So, this is how a typical app starts with.
void main() { runApp(MaterialApp( home: Scaffold( appBar: AppBar(), body: YourWidget(), ), )); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With