About the Author |
|
xvii | |
About the Technical Reviewer |
|
xix | |
Who is this book for? |
|
xxi | |
|
Part I Introduction to Flutter |
|
|
1 | (28) |
|
|
3 | (6) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (2) |
|
|
7 | (1) |
|
|
8 | (1) |
|
Chapter 2 Developing in Flutter |
|
|
9 | (20) |
|
|
10 | (8) |
|
|
10 | (1) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
13 | (2) |
|
Keeping the tools up to date |
|
|
15 | (3) |
|
The Flutter development process |
|
|
18 | (9) |
|
Scaffolding the app and files |
|
|
18 | (3) |
|
|
21 | (6) |
|
|
27 | (2) |
|
Part II Foundational Flutter |
|
|
29 | (176) |
|
Chapter 3 Everything Is Widgets |
|
|
31 | (16) |
|
|
33 | (2) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
How to create your own stateless widgets |
|
|
38 | (7) |
|
|
41 | (1) |
|
Passing a value into your widget |
|
|
42 | (3) |
|
Stateless and Stateful widgets |
|
|
45 | (1) |
|
So which one should I create? |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (30) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (5) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (3) |
|
|
54 | (22) |
|
|
55 | (10) |
|
Putting the form widgets together |
|
|
65 | (1) |
|
|
65 | (2) |
|
|
67 | (4) |
|
|
71 | (5) |
|
|
76 | (1) |
|
Chapter 5 Responding to Gestures |
|
|
77 | (16) |
|
|
78 | (5) |
|
|
80 | (1) |
|
FlatButton and IconButton |
|
|
81 | (1) |
|
|
81 | (1) |
|
|
82 | (1) |
|
|
83 | (1) |
|
Custom gestures for your custom widgets |
|
|
83 | (4) |
|
Step 1 Decide on your gestures and behaviors |
|
|
84 | (1) |
|
Step 2 Create your custom widget |
|
|
85 | (1) |
|
Step 3 Add a GestureDetector widget |
|
|
86 | (1) |
|
Step 4 Associate your gesture with its behavior |
|
|
87 | (1) |
|
Example 1 Reacting to a long press |
|
|
87 | (2) |
|
Example 2 Pinching to add a new item |
|
|
89 | (1) |
|
Example 3 Swiping left or right |
|
|
90 | (2) |
|
What if there are two or more gestures happening at the same time? |
|
|
92 | (1) |
|
|
92 | (1) |
|
Chapter 6 Laying Out Your Widgets |
|
|
93 | (46) |
|
Laying out the whole scene |
|
|
100 | (6) |
|
|
100 | (1) |
|
|
101 | (1) |
|
|
102 | (2) |
|
|
104 | (1) |
|
|
105 | (1) |
|
How Flutter decides on a widget's size |
|
|
106 | (4) |
|
The dreaded "unbounded height" error |
|
|
107 | (1) |
|
Flutter's layout algorithm |
|
|
108 | (2) |
|
Putting widgets next to or below others |
|
|
110 | (3) |
|
Your widgets will never fit! |
|
|
113 | (1) |
|
What if there's extra space left over? |
|
|
113 | (8) |
|
|
113 | (2) |
|
|
115 | (2) |
|
|
117 | (4) |
|
What if there's not enough space? |
|
|
121 | (3) |
|
|
121 | (3) |
|
Container widget and the box model |
|
|
124 | (6) |
|
Alignment and positioning within a Container |
|
|
126 | (2) |
|
So how do you determine the size of a Container? |
|
|
128 | (2) |
|
|
130 | (7) |
|
|
130 | (1) |
|
|
131 | (3) |
|
|
134 | (3) |
|
|
137 | (2) |
|
Chapter 7 Navigation and Routing |
|
|
139 | (20) |
|
|
140 | (4) |
|
Navigating forward and back |
|
|
141 | (2) |
|
Get result after a scene is closed |
|
|
143 | (1) |
|
|
144 | (6) |
|
|
146 | (2) |
|
|
148 | (2) |
|
|
150 | (3) |
|
|
151 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
153 | (4) |
|
Showdialog() and AlertDialog |
|
|
154 | (1) |
|
|
155 | (2) |
|
Navigation methods can be combined |
|
|
157 | (2) |
|
Chapter 8 Styling Your Widgets |
|
|
159 | (28) |
|
Thinking in Flutter Styles |
|
|
160 | (1) |
|
|
161 | (2) |
|
|
163 | (5) |
|
|
163 | (2) |
|
|
165 | (3) |
|
|
168 | (8) |
|
|
170 | (2) |
|
|
172 | (1) |
|
|
173 | (3) |
|
|
176 | (4) |
|
|
178 | (2) |
|
|
180 | (1) |
|
|
181 | (5) |
|
Applying theme properties |
|
|
183 | (3) |
|
|
186 | (1) |
|
|
187 | (18) |
|
|
187 | (2) |
|
What goes in a StatefulWidget? |
|
|
189 | (1) |
|
The most important rule about state! |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
192 | (1) |
|
An example of state management |
|
|
193 | (5) |
|
When should we use state? |
|
|
198 | (2) |
|
Advanced state management |
|
|
200 | (3) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
202 | (1) |
|
|
202 | (1) |
|
Whoa! That's a lot of packages! |
|
|
203 | (1) |
|
|
203 | (2) |
|
Part III Above and Beyond |
|
|
205 | (82) |
|
Chapter 10 Your Flutter App Can Work with Files |
|
|
207 | (20) |
|
Including libraries in your Flutter app |
|
|
208 | (3) |
|
|
208 | (2) |
|
|
210 | (1) |
|
|
210 | (1) |
|
|
211 | (1) |
|
Futures, async, and await |
|
|
211 | (5) |
|
|
212 | (1) |
|
How do we get the data from a Future? |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
215 | (1) |
|
Including a file with your app |
|
|
216 | (2) |
|
|
218 | (2) |
|
|
219 | (1) |
|
|
220 | (3) |
|
Writing your app's memory to JSON |
|
|
221 | (1) |
|
Reading JSON into your app's memory |
|
|
222 | (1) |
|
|
223 | (2) |
|
|
224 | (1) |
|
|
224 | (1) |
|
|
225 | (2) |
|
Chapter 11 Making RESTful API Calls with HTTP |
|
|
227 | (28) |
|
|
228 | (1) |
|
The flavors of API requests |
|
|
228 | (2) |
|
Making an HTTP GET or DELETE request |
|
|
230 | (1) |
|
Making an HTTP PUT, POST, or PATCH request |
|
|
231 | (1) |
|
HTTP responses to widgets |
|
|
232 | (6) |
|
Brute force - The easy way |
|
|
233 | (1) |
|
FutureBuilder-The clean way |
|
|
234 | (4) |
|
|
238 | (2) |
|
|
238 | (1) |
|
Write a fromJSON() method |
|
|
239 | (1) |
|
Use fromJSON() to hydrate the object |
|
|
240 | (1) |
|
|
240 | (14) |
|
|
242 | (1) |
|
|
243 | (1) |
|
Making a strongly typed business class |
|
|
243 | (1) |
|
|
244 | (3) |
|
|
247 | (1) |
|
A DELETE request in Flutter |
|
|
247 | (1) |
|
|
248 | (4) |
|
A POST and PUT request in Flutter |
|
|
252 | (2) |
|
|
254 | (1) |
|
Chapter 12 Using Firebase with Flutter |
|
|
255 | (32) |
|
|
256 | (3) |
|
|
257 | (1) |
|
|
258 | (1) |
|
|
259 | (1) |
|
Setting up Firebase itself |
|
|
259 | (19) |
|
(1) Creating a Firebase project |
|
|
260 | (3) |
|
(2) Creating the database |
|
|
263 | (4) |
|
|
267 | (6) |
|
(4) Creating an Android app |
|
|
273 | (4) |
|
(5) Adding FlutterFire plugins |
|
|
277 | (1) |
|
|
278 | (5) |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
281 | (1) |
|
|
282 | (1) |
|
|
283 | (4) |
|
Appendix A Dart Language Overview |
|
|
287 | (16) |
|
|
287 | (1) |
|
Expected features -- Dart Cheatsheet |
|
|
288 | (2) |
|
|
288 | (1) |
|
|
289 | (1) |
|
|
289 | (1) |
|
|
290 | (1) |
|
|
290 | (1) |
|
|
291 | (1) |
|
Unexpected things about Dart |
|
|
291 | (8) |
|
|
292 | (1) |
|
|
292 | (1) |
|
Variables are initialized to null |
|
|
293 | (1) |
|
String interpolation with $ |
|
|
294 | (1) |
|
|
294 | (1) |
|
|
294 | (1) |
|
|
295 | (1) |
|
|
295 | (1) |
|
|
296 | (1) |
|
Named function parameters |
|
|
296 | (1) |
|
Omitting "new" and "this." |
|
|
297 | (1) |
|
Class constructor parameter shorthand |
|
|
298 | (1) |
|
|
299 | (4) |
|
|
299 | (1) |
|
The cascade operator (..) |
|
|
300 | (1) |
|
|
301 | (1) |
|
|
301 | (2) |
Index |
|
303 | |