Flutter: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
iwu
 
add Programming Notes
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 4: Line 6:
$ flutter packages get
$ flutter packages get
Running "flutter packages get" in a1...                      1.0s
Running "flutter packages get" in a1...                      1.0s
</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">
void main() {
runApp(
Center: Text(
'Hello, world!',
textDirection: TextDirection.ltr
)
);
}
</source>
</source>

Revision as of 22:00, 26 September 2018

Set up

Get all packages based on pubspec.yaml.

$ flutter packages get
Running "flutter packages get" in a1...                      1.0s


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.

void main() {
	runApp(
		Center: Text(
			'Hello, world!',
			textDirection: TextDirection.ltr
		)
	);
}