Skip to content

Commit e4f5664

Browse files
committed
fix: Updating README before building tutorial. #27
1 parent 157eaab commit e4f5664

File tree

1 file changed

+81
-75
lines changed

1 file changed

+81
-75
lines changed

README.md

Lines changed: 81 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,108 @@
1-
# Flutter TodoList Tutorial
2-
3-
Create 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>
7-
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-
```
1+
# Flutter Todo App Tutorial
322

33-
## Flutter concepts
3+
Quickly learn how to setup
4+
a Todo list management app
5+
using `Flutter` and `Riverpod`
6+
for app state management.
347

35-
### Widgets
8+
# What? 💡
369

37-
Flutter is using Widgets to create the applications' UI.
38-
Widgets let you declare how and what to render on the screen.
10+
This is a simple **Todo list application**
11+
that allows you to track todo items that you
12+
create and edit.
13+
You can check your current active todo items,
14+
check the completed ones and
15+
also have an overview of every task you've created.
16+
Oh! And it's also fully tested! 😃
3917

40-
Widgets can be composed to create more complex UI, creating a widgets tree,
41-
similar to the [Document Object Model](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction)
42-
which is used to represent html pages.
18+
This app connects to an API
19+
implemented with [`Phoenix`](https://github.com/dwyl/learn-phoenix-framework)
20+
to persist the todo list items.
4321

44-
For example a todo list app could be represented with the follownig wireframe:
22+
# Why? 🤷
4523

46-
![todolist-app](https://user-images.githubusercontent.com/6057298/93343915-f3bf4400-f828-11ea-9087-d7cac865cecd.png)
24+
As we are focused on building our [`mvp`](https://github.com/dwyl/mvp),
25+
we are looking to have the frontend counterpart
26+
that is **cross-platform** and fastly *iterable*.
27+
Setting this walkthrough will help *you*
28+
understand better the fundamentals of having
29+
an app with a robust state management library
30+
that can be used in **real-world applications**.
4731

48-
From there we can start to have an idea of the widgets tree structure:
32+
It also helps *us* to have a detailed guide
33+
of a fully tested app that is documented
34+
and is something we can go back to. 😊
35+
36+
# How? 💻
37+
38+
## 0. Prerequisites and preview
39+
40+
It's advisable to have a basic understanding
41+
of the `Dart`-lang and of `Flutter`.
42+
If this is your first tutorial with Flutter,
43+
we *highly* advise you to check our
44+
learning repositories to get started!
45+
46+
https://github.com/dwyl/learn-dart
47+
48+
https://github.com/dwyl/learn-flutter
4949

50-
![widgets-tree](https://user-images.githubusercontent.com/6057298/93343977-03d72380-f829-11ea-8c4b-dc964c591e97.png)
5150

52-
see also:
51+
Before building this app,
52+
let's check out the final result!
53+
After cloning this repository
54+
and traveling to the directory you cloned the repo in,
55+
run the following command to install the dependencies.
5356

54-
- Introduction to widgets: <https://flutter.dev/docs/development/ui/widgets-intro>
55-
- Widget catalog: <https://flutter.dev/docs/development/ui/widgets>
56-
- widget index: <https://flutter.dev/docs/reference/widgets>
57-
- widget of the week on Youtube: <https://www.youtube.com/watch?v=b_sQ9bMltGU&list=PLjxrf2q8roU23XGwz3Km7sQZFTdB996iG>
57+
```sh
58+
flutter pub get
59+
```
5860

59-
### Create a new Flutter application
61+
To run the app, plug your phone
62+
or start the emulator and run the following.
6063

61-
#### A quick CLI tour
64+
```sh
65+
flutter devices
66+
```
6267

63-
You can create a new Flutter project with the following command line:
68+
If you find the wanted device, run:
6469

6570
```sh
66-
flutter create --org com.dwyl --project-name todolist .
71+
flutter run
6772
```
6873

69-
This will create the project `todolist` in the current folder `.`.
70-
The `--org` flag uses the [reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation) to identify your application.
74+
And you should get your app running!
7175

72-
You can then run the application with `flutter run` and run the tests with `flutter test`.
76+
If you want a more in-depth guide
77+
of how to get a Flutter app running
78+
on a real device or emulator,
79+
check our [`learn-flutter`](https://github.com/dwyl/learn-flutter)
80+
tutorial.
81+
We will get you sorted in no time!
7382

74-
For the list of command type `flutter help`.
75-
For more details about a specific command, for example `create`, run `flutter create --help`
83+
If you open the app,
84+
you should be able to see the following.
7685

77-
#### Material Design
86+
![preview](https://user-images.githubusercontent.com/17494745/205381031-2f11e74a-34d2-45de-bc32-bbb9d4bf9401.gif)
7887

79-
[Material Design](https://material.io/design/introduction) is a guideline to create user interface.
80-
Flutter implements the guideline with the [material components widgets](https://flutter.dev/docs/development/ui/widgets/material).
81-
This list of widgest allow us to create rapdly a UI folling the best practices from material design.
82-
To use these widgets you need first to import the `material` Dart package with `import 'package:flutter/material.dart';`
83-
You can then browse all the material widgets and select the ones required for your application <https://api.flutter.dev/flutter/material/material-library.html>
8488

85-
You have also the possiblity to create an IOs look by using the [Cupertino widgets package](https://flutter.dev/docs/development/ui/widgets/cupertino)
89+
All the tests should also pass.
90+
If you want to check this,
91+
you can run `flutter test`.
8692

87-
#### Main Widgets used
93+
This app uses [`Riverpod`](https://riverpod.dev/)
94+
for state management inside the widget tree.
95+
This library will allow us to declare
96+
and use shared state from anywhere
97+
and have a greater control on
98+
UI rebuilds.
8899

89-
- [Scaffold](https://api.flutter.dev/flutter/material/Scaffold-class.html)
90-
- [AppBar](https://api.flutter.dev/flutter/material/AppBar-class.html)
91-
- [CheckboxListTile](https://api.flutter.dev/flutter/material/CheckboxListTile-class.html)
92-
- [ListView](https://api.flutter.dev/flutter/widgets/ListView-class.html)
93-
- [TextField](https://api.flutter.dev/flutter/material/TextField-class.html)
94-
- [Column](https://api.flutter.dev/flutter/widgets/Column-class.html)
95-
- [Expanded](https://api.flutter.dev/flutter/widgets/Expanded-class.html)
96100

97-
Note that the `Column` and `Exapanded` widgets are "space" widgets.
101+
Here is how our widget tree
102+
will look like.
103+
104+
![widgets-tree](https://user-images.githubusercontent.com/6057298/93343977-03d72380-f829-11ea-8c4b-dc964c591e97.png)
105+
106+
## 1. Project setup
98107

99-
Flutter provide a widget inspector where you can see the full tree
100-
of the application:
101108

102-
![widget tree](https://user-images.githubusercontent.com/6057298/93480078-f6876b00-f8f4-11ea-95df-3c81321e8284.png)

0 commit comments

Comments
 (0)