Beginning Flutter with Dart by Sinha Sanjib

Beginning Flutter with Dart by Sinha Sanjib

Author:Sinha, Sanjib
Language: eng
Format: epub
Publisher: leanpub.com
Published: 2021-03-20T00:00:00+00:00


We have used two Dart files, ‘testing_my_first_app.dart’ and the ‘main.dart’. We have made our ‘main.dart’ file just a one-line code:

1 void main(List<String> args) => runApp(MyFirstApp());

We have seen the fat arrow notation ‘⇒’ before in our Dart practices. It can reduce any function to one line of code, when it calls one function.

The ‘testing_my_first_app.dart’ file starts with the Scaffold widget that has two main sub-trees widgets – appbar, and body. Let us see some code snippets from the appbar widget first.

1 appBar: AppBar( 2 leading: IconButton( 3 icon: Icon(Icons.menu), 4 tooltip: 'Navigation menu', 5 onPressed: null, 6 ), 7 title: Text( 8 'Test Your Knowledge...', 9 style: TextStyle( 10 fontSize: 25.00, 11 fontStyle: FontStyle.normal, 12 ), 13 ), 14 actions: <Widget>[ 15 IconButton( 16 icon: Icon(Icons.search), 17 tooltip: 'Search', 18 onPressed: null, 19 ), 20 ], 21 backgroundColor: Colors.redAccent, 22 ),



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.