10. 2011.10 Dart 1
• General-purpose programming language
• Object-oriented, class defined, single inheritance
• C-style syntax similar to JavaScript, Java
2018.2 Dart 2
• Type system
• Compiled as JavaScript by dart2js
• Stand-alone Dart VM
• For web, server and mobile applications
• Fastest growing language inside Google
10
16. •Stateless Widgets
• 상태 없음
• Icon, IconButton, Text
•Stateful Widgets
• 상태에 따라 위젯이 변동
• Checkbox, Radio, Form, TextField
• 상태는 State 객체에 저장
• 위젯의 상태가 변경될 때, setState() 호출하여 위젯을
다시 그림
16
17. class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
Widget titleSection = new Container(
child: new Row(
children: [
new Expanded(
child: new Column()
),
new FavoriteWidget(),
],
),
);
return new MaterialApp();
}
}
17
18. @override
Widget build(BuildContext context) {
return new Row(
children: [
new Container(
child: new RaisedButton(
child: new Text(widget.title),
onPressed: _toggleFavorite,
),
),
new SizedBox(
child: new Container(
child: new Text('$_favoriteCount'),
),
),
],
18
class FavoriteWidget extends StatefulWid
get {
final String title;
FavoriteWidget(this.title);
@override
_FavoriteWidgetState createState()
=> new _FavoriteWidgetState();
}
class _FavoriteWidgetState extends State
<FavoriteWidget> {
int _favoriteCount = 41;
void _toggleFavorite() {
setState(() {
_favoriteCount += 1;
});
}
33. • I/O '18 Guide - Flutter
• I/O '18 Guide - Interview on Flutter Beta 3
• Customize Material Components for your product
• Build great Material Design products across platforms
• Code beautiful UI with Flutter and Material Design
• Total mobile development made fun with Flutter and
Firebase
• Add Firebase to your cross-platform React Native or
Flutter app
• Build reactive mobile apps with Flutter
33
43. “If there’s one thing that we’d like you to take away from this,
It’s that Flutter’s widgets, in combination with Streams, gives you a ver
y reactive way to not only handle your UI but handle the flow of data
through your app, and handle the updating of your UI when that data
changes. So we highly recommend you go and check out Dart Stre
ams, and the rxdart as an option for building state in your apps.”