4,348
edits
iwu |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Set up = | |||
Get all packages based on <span class="package">pubspec.yaml</span>. | Get all packages based on <span class="package">pubspec.yaml</span>. | ||
Line 5: | Line 7: | ||
Running "flutter packages get" in a1... 1.0s | Running "flutter packages get" in a1... 1.0s | ||
</source> | </source> | ||
= Programming Notes = | |||
''runApp()'' function takes the given Widget and makes it the root of the widget tree. The following makes the Center widget the root. | |||
<source lang="dart" highlight="3"> | |||
void main() { | |||
runApp( | |||
Center: Text( | |||
'Hello, world!', | |||
textDirection: TextDirection.ltr | |||
) | |||
); | |||
} | |||
</source> | |||
A widget's main job is to implement a '''build''' function, which describes the widget in terms of other, lower-level widgets. |