11# Flutter TodoList Tutorial  
22
33Create a simple todolist Flutter application
4+ <div  align =" center " >
5+   <img  src =" https://user-images.githubusercontent.com/6057298/109024720-f4041b00-76b5-11eb-9221-ad8660315a0b.gif "  height =" 600 " >
6+ </div >
47
5- ## Widgets  
8+ To run the project on your machine:
9+ -  make sure you have Dart and Flutter installed: https://flutter.dev/docs/get-started/install 
10+ -  clone this repository with 
` git clone [email protected] :dwyl/flutter-todo-list-tutorial.git ` 11+ -  Before running the application check that all the tests are passing with ` flutter test ` 
12+ 
13+ The application contains the following main folders:
14+ 
15+ -  ` lib/models `  Contains the ` task `  and ` todolist `  models
16+ -  ` lib/screens `  Contains the different screens of the application. Currently only the tasks screen exists.
17+   In the tasks folder you can find the task, tasks and todolist widgets which define the UI of this screen.
18+ -  ` lib/widgets `  This folder is used to store widgets used on multiple screen, currently this folder is empty
19+ -  ` test `  This contains the unit, widget and integration tests.
20+ 
21+ The application is using [ Provider] ( https://pub.dev/packages/provider )  to manage the states.
22+ Providers allow us to notify the UI of the application when a state change. For example when a
23+ task is toggled the ` notifyListener `  function is called which let the application knows that a refresh of the
24+ task's UI is required: 
25+ 
26+ ``` dart 
27+   void toggle() { 
28+     completed = !completed; 
29+     notifyListeners(); 
30+   } 
31+ ``` 
32+ 
33+ ## Flutter concepts  
34+ 
35+ ### Widgets  
636
737Flutter is using Widgets to create the applications' UI.
838Widgets let you declare how and what to render on the screen.
@@ -26,9 +56,9 @@ see also:
2656-  widget index: < https://flutter.dev/docs/reference/widgets > 
2757-  widget of the week on Youtube: < https://www.youtube.com/watch?v=b_sQ9bMltGU&list=PLjxrf2q8roU23XGwz3Km7sQZFTdB996iG > 
2858
29- ## Create a new Flutter application  
59+ ###  Create a new Flutter application  
3060
31- ### A quick CLI tour  
61+ ####  A quick CLI tour  
3262
3363You can create a new Flutter project with the following command line:
3464
@@ -44,7 +74,7 @@ You can then run the application with `flutter run` and run the tests with `flut
4474For the list of command type ` flutter help ` .
4575For more details about a specific command, for example ` create ` , run ` flutter create --help ` 
4676
47- ### Material Design  
77+ ####  Material Design  
4878
4979[ Material Design] ( https://material.io/design/introduction )  is a guideline to create user interface.
5080Flutter implements the guideline with the [ material components widgets] ( https://flutter.dev/docs/development/ui/widgets/material ) .
@@ -54,7 +84,7 @@ You can then browse all the material widgets and select the ones required for yo
5484
5585You have also the possiblity to create an IOs look by using the [ Cupertino widgets package] ( https://flutter.dev/docs/development/ui/widgets/cupertino ) 
5686
57- ### Main Widgets used  
87+ ####  Main Widgets used  
5888
5989-  [ Scaffold] ( https://api.flutter.dev/flutter/material/Scaffold-class.html ) 
6090-  [ AppBar] ( https://api.flutter.dev/flutter/material/AppBar-class.html ) 
@@ -69,44 +99,4 @@ Note that the `Column` and `Exapanded` widgets are "space" widgets.
6999Flutter provide a widget inspector where you can see the full tree
70100of the application:
71101
72- ![ widget tree] ( https://user-images.githubusercontent.com/6057298/93480078-f6876b00-f8f4-11ea-95df-3c81321e8284.png ) 
73- 
74- ### Create the application  
75- 
76- -  [ runApp] ( https://api.flutter.dev/flutter/widgets/runApp.html ) 
77- -  [ MaterialApp] ( https://api.flutter.dev/flutter/material/MaterialApp-class.html ) 
78- 
79- Dart requires a ` main `  function to be defined to create the start of your program.
80- 
81- ``` dart 
82- void main() { 
83-     print('hello'); 
84- } 
85- ``` 
86- 
87- the ` runApp `  function is used in the main function and takes a widget as parameter.
88- This widget becomes the root element of your application and it is displayed on the
89- user screen.
90- 
91- The ` MaterialApp `  widget create a material design application.
92- 
93- ``` dart 
94- void main() { 
95-   runApp(MaterialApp(title: 'TodoList', home: App())); 
96- ``` 
97- 
98- Note that the ` App `  widget is created later on as a ` StatelessWidget ` .
99- 
100- see also:
101- 
102- -  < https://medium.com/@greg.perry/decode-materialapp-b730ee4eaed1 > 
103- 
104- ### Stateless and Statefull widget  
105- 
106- ### Tests  
107- 
108- #### Unit tests  
109- 
110- #### Widget tests  
111- 
112- #### Integration tests  
102+ ![ widget tree] ( https://user-images.githubusercontent.com/6057298/93480078-f6876b00-f8f4-11ea-95df-3c81321e8284.png ) 
0 commit comments