ݺߣ

ݺߣShare a Scribd company logo
Intro to Flutter
Eason Pai
2017
What is Flutter?
 Flutter is a new project to help developers build high-performance,
high-fidelity, mobile apps for iOS and Android from a single codebase.
-- https://flutter.io/ (gһˬpƽ̨ (again!?))
 Features (Summarized):
 Performance (AOT Compiling, Flutter Framework)
 Highly productive and fast development (Hot Reload)
 Well documented FAQ: https://flutter.io/faq/
 Try Flutter Gallery on official Android App at Play Store
Flutter Architecture
 Flutter System Architecture (2015)
Feature: AOT Compiling
 AOT compiling Dart for iOS Android (Dart Developer Summit 2016) [Youtube]
 iOS Restriction: Cannot JIT (Dart VM) (2015)
 Apply to Android for >3X Faster startup, Speed and Size enhancement (2016)
 Compare to React Native?
Getting Interesting? (1)
 Discusses
 from Android/iOS developers
 Sam Lu
 from UX Designers
 FAQ: Tips and tools for getting started in user
experience design (aka UX): Im still very new to
prototyping but my team uses Flutter which is an
open-sourced framework for building cross-platform
UIslearning how to use it has been challenging
because its my first programming experience but
extremely rewarding. (UX @Google)
 Dart is 17 at TIOBE Index for January 2017
Getting Interesting? (2)
 Learnings from building a CRM app at Google (Dart Developer
Summit 2016)
 Web App
 Google built its own CRM system, big project that
including Customer, Revenue, Planning, Collaboration
function
 3 years running, 30 Dart Developers, 800 AngularDart
Components
 0%  100% in 6 months (3 years ago, with ng1)
 Mobile App
 demo video (The same bug on both Android/iOS XD)
 Experience: Productive, Fun, Easy, Fidelity, Write
once, Share with web
 Functional-Reactive Framework & React-like
 Functional Reactive Programming?
 30 쾫ͨ RxJS (01)JR RxJSFunctional Reactive Programming һN̹ʽ
(programming paradigm)... RxJS _ Functional Programming  Reactive
Programming ĽYϣܷܲQ Functional Reactive Programming (FRP) һֱР
h
 Functional ProgrammingǾ  function ˼҂Ć}Լ׫ʽ 
 Reactive Programming ΁f ׃YԴl׃ӕr׃YԴ
ӸVҰl׃ 
 Flutter FAQThe Flutter framework uses a functional-reactive style programming model, whose
performance depends heavily on the underlying memory allocator efficiently handling small,
short-lived allocations. The functional-reactive style was developed in languages with this property
and does not work efficiently in languages that lack this facility. (gܽFR)
Flutter Framework (1)
Flutter Quick Start
 Flutter Setup
 SDK  iOS Setup, Android Setup  IDE (IntelliJ, Atom)
 flutter doctor
 Mac or Linux Only. Windows support is planned.
 Android 4.1 (API level 16) or higher.
 Getting Started with Flutter
 Create project
 Hot Reload
Feature:
Hot Reload
 Flutter Hot Reload (Dart Developer Summit 2016) [Youtube]
 Hello World
 To see more widges,
 check the official Android app Flutter Gallery
 or the list on web https://flutter.io/widgets/
Flutter Framework (2)
import 'package:flutter/material.dart';
void main() {
runApp(new Center(child: new Text('Hello, world!')));
}
 Custom Widget
 Widgets
 Any of the widgets will extend
StatefulWidget or StatelessWidget
 StatelessWidget
 All member is final
 Its state cannot be changed
 Immutability
 Example: Text
Flutter Framework (3) void main() {
runApp(new MyWidget("Hello Cool App"));
}
class MyWidget extends StatelessWidget {
final String hello;
MyWidget(this.hello);
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(hello)
),
body: new Center(
child: new Text('A Text Widget')),
);
}
}
Flutter Framework (4)
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new Center(
child: new Text(
'Button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
),
),
floatingActionButton: new FloatingActionButton(
onPressed: _incrementCounter,
),
);
}
}
 StatefulWidget
 is a Mutable Widget, state can be
changed
 Example : A list of items. This list will
contain the items internally, items grow
when data retrieved from server
Flutter Framework (5)
 StatefulWidget
 "BǷ׃"^nyview tier solution
fBָ"viewǷԱL"
 StatelessWidgetһ new ͟oٱ£ֻñ
 new һ
 LDCЧʵֻ׃ӵIJ֣Ҫview
treeһ
 "viewǷԱL"" ͸^ɷNһӵ
Class API LD ( setState() )
 Performance?
 no worries, createState() taking care of it
List
Item
Item
Accessing Platforms
 ĿǰֻARM-based CPU
  android emulator!
 CPU֧Ԯ}Ҳ
 ѽɮaCPUܘsoֻ
package tool chain ߀]ӑBذson
Mȥ
 ԸFеandroid, ios
framework  UI & Code
 ٷй hello_service 

 Accessing Platform and
Third-Party Services in Flutter
Thanks
gӭFBF Dartisian@twһӑՓ
https://www.facebook.com/groups/Dart.tw/

More Related Content

What's hot (20)

A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
Ahmed Tarek
?
Flutter Festival - Intro Session
Flutter Festival - Intro SessionFlutter Festival - Intro Session
Flutter Festival - Intro Session
Google Developer Students Club NIT Silchar
?
Flutter
FlutterFlutter
Flutter
Ankit Kumar
?
Building beautiful apps using google flutter
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutter
Ahmed Abu Eldahab
?
Flutter for web
Flutter for web Flutter for web
Flutter for web
rihannakedy
?
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
Bartosz Kosarzycki
?
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
Vishnu Suresh
?
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
Apoorv Pandey
?
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
?
Flutter festival - Write your first Flutter application
Flutter festival - Write your first Flutter applicationFlutter festival - Write your first Flutter application
Flutter festival - Write your first Flutter application
Apoorv Pandey
?
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
Sergi Martnez
?
Flutter
FlutterFlutter
Flutter
Himanshu Singh
?
Flutter UI Framework
Flutter UI FrameworkFlutter UI Framework
Flutter UI Framework
Yuliia Makarenko
?
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Sambhu Lakshmanan
?
Configuration management II - Terraform
Configuration management II - TerraformConfiguration management II - Terraform
Configuration management II - Terraform
Xavier Serrat Bordas
?
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)
Priyanka Tyagi
?
Flutter
FlutterFlutter
Flutter
Toma Velev
?
Core java
Core java Core java
Core java
Shubham singh
?
Android - ADB
Android - ADBAndroid - ADB
Android - ADB
Yossi Gruner
?
Dart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptx
DSCVSSUT
?

Similar to Intro to Flutter (20)

20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
?
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
wesley chun
?
Gwt.create
Gwt.createGwt.create
Gwt.create
Mauricio (Salaboy) Salatino
?
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Tools
barciszewski
?
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Mo?ino
?
Introduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJsIntroduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJs
Luca Galli
?
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
digitaljoni
?
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
?
GoogleDSC_ GHRCE_ flutter_firebase.pptx
GoogleDSC_ GHRCE_  flutter_firebase.pptxGoogleDSC_ GHRCE_  flutter_firebase.pptx
GoogleDSC_ GHRCE_ flutter_firebase.pptx
GoogleDeveloperStude22
?
React Workshop
React WorkshopReact Workshop
React Workshop
GDSC UofT Mississauga
?
React native
React nativeReact native
React native
Vishal Dubey
?
Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
Mike Nakhimovich
?
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
Mauricio (Salaboy) Salatino
?
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
Khor SoonHin
?
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
wesley chun
?
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
Toma Velev
?
Apache Flex and the imperfect Web
Apache Flex and the imperfect WebApache Flex and the imperfect Web
Apache Flex and the imperfect Web
masuland
?
Ionic2, les dveloppeurs web l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les dveloppeurs web  l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les dveloppeurs web  l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les dveloppeurs web l'assaut du mobile, BDX I/O le 21/10/2016
Lo?c Knuchel
?
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
?
Deep dive into Android async operations
Deep dive into Android async operationsDeep dive into Android async operations
Deep dive into Android async operations
Mateusz Grzechociski
?
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
?
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
wesley chun
?
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Tools
barciszewski
?
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Mo?ino
?
Introduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJsIntroduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJs
Luca Galli
?
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
digitaljoni
?
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
?
Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
Mike Nakhimovich
?
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
Khor SoonHin
?
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
wesley chun
?
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
Toma Velev
?
Apache Flex and the imperfect Web
Apache Flex and the imperfect WebApache Flex and the imperfect Web
Apache Flex and the imperfect Web
masuland
?
Ionic2, les dveloppeurs web l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les dveloppeurs web  l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les dveloppeurs web  l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les dveloppeurs web l'assaut du mobile, BDX I/O le 21/10/2016
Lo?c Knuchel
?
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
?
Deep dive into Android async operations
Deep dive into Android async operationsDeep dive into Android async operations
Deep dive into Android async operations
Mateusz Grzechociski
?

Intro to Flutter

  • 2. What is Flutter? Flutter is a new project to help developers build high-performance, high-fidelity, mobile apps for iOS and Android from a single codebase. -- https://flutter.io/ (gһˬpƽ̨ (again!?)) Features (Summarized): Performance (AOT Compiling, Flutter Framework) Highly productive and fast development (Hot Reload) Well documented FAQ: https://flutter.io/faq/ Try Flutter Gallery on official Android App at Play Store
  • 3. Flutter Architecture Flutter System Architecture (2015)
  • 4. Feature: AOT Compiling AOT compiling Dart for iOS Android (Dart Developer Summit 2016) [Youtube] iOS Restriction: Cannot JIT (Dart VM) (2015) Apply to Android for >3X Faster startup, Speed and Size enhancement (2016) Compare to React Native?
  • 5. Getting Interesting? (1) Discusses from Android/iOS developers Sam Lu from UX Designers FAQ: Tips and tools for getting started in user experience design (aka UX): Im still very new to prototyping but my team uses Flutter which is an open-sourced framework for building cross-platform UIslearning how to use it has been challenging because its my first programming experience but extremely rewarding. (UX @Google) Dart is 17 at TIOBE Index for January 2017
  • 6. Getting Interesting? (2) Learnings from building a CRM app at Google (Dart Developer Summit 2016) Web App Google built its own CRM system, big project that including Customer, Revenue, Planning, Collaboration function 3 years running, 30 Dart Developers, 800 AngularDart Components 0% 100% in 6 months (3 years ago, with ng1) Mobile App demo video (The same bug on both Android/iOS XD) Experience: Productive, Fun, Easy, Fidelity, Write once, Share with web
  • 7. Functional-Reactive Framework & React-like Functional Reactive Programming? 30 쾫ͨ RxJS (01)JR RxJSFunctional Reactive Programming һN̹ʽ (programming paradigm)... RxJS _ Functional Programming Reactive Programming ĽYϣܷܲQ Functional Reactive Programming (FRP) һֱР h Functional ProgrammingǾ function ˼҂Ć}Լ׫ʽ Reactive Programming ΁f ׃YԴl׃ӕr׃YԴ ӸVҰl׃ Flutter FAQThe Flutter framework uses a functional-reactive style programming model, whose performance depends heavily on the underlying memory allocator efficiently handling small, short-lived allocations. The functional-reactive style was developed in languages with this property and does not work efficiently in languages that lack this facility. (gܽFR) Flutter Framework (1)
  • 8. Flutter Quick Start Flutter Setup SDK iOS Setup, Android Setup IDE (IntelliJ, Atom) flutter doctor Mac or Linux Only. Windows support is planned. Android 4.1 (API level 16) or higher. Getting Started with Flutter Create project Hot Reload
  • 9. Feature: Hot Reload Flutter Hot Reload (Dart Developer Summit 2016) [Youtube]
  • 10. Hello World To see more widges, check the official Android app Flutter Gallery or the list on web https://flutter.io/widgets/ Flutter Framework (2) import 'package:flutter/material.dart'; void main() { runApp(new Center(child: new Text('Hello, world!'))); }
  • 11. Custom Widget Widgets Any of the widgets will extend StatefulWidget or StatelessWidget StatelessWidget All member is final Its state cannot be changed Immutability Example: Text Flutter Framework (3) void main() { runApp(new MyWidget("Hello Cool App")); } class MyWidget extends StatelessWidget { final String hello; MyWidget(this.hello); @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text(hello) ), body: new Center( child: new Text('A Text Widget')), ); } }
  • 12. Flutter Framework (4) class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => new _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return new Scaffold( body: new Center( child: new Text( 'Button tapped $_counter time${ _counter == 1 ? '' : 's' }.', ), ), floatingActionButton: new FloatingActionButton( onPressed: _incrementCounter, ), ); } } StatefulWidget is a Mutable Widget, state can be changed Example : A list of items. This list will contain the items internally, items grow when data retrieved from server
  • 13. Flutter Framework (5) StatefulWidget "BǷ׃"^nyview tier solution fBָ"viewǷԱL" StatelessWidgetһ new ͟oٱ£ֻñ new һ LDCЧʵֻ׃ӵIJ֣Ҫview treeһ "viewǷԱL"" ͸^ɷNһӵ Class API LD ( setState() ) Performance? no worries, createState() taking care of it List Item Item
  • 14. Accessing Platforms ĿǰֻARM-based CPU android emulator! CPU֧Ԯ}Ҳ ѽɮaCPUܘsoֻ package tool chain ߀]ӑBذson Mȥ ԸFеandroid, ios framework UI & Code ٷй hello_service Accessing Platform and Third-Party Services in Flutter