Flutter Intro

Flutter
Vladimir Parfenov
Intro
https://flutter.io/
• Native mobile app SDK
• Android / iOS / Fuchsia / Web
• Dart programming language
2
Sample
3
Other frameworks
4
https://medium.com/@openGeeksLab/flutter-vs-react-native-what-you-need-to-know-89451da3
https://blog.novoda.com/react-native-flutter-xamarin-a-comparison/
How Flutter works
https://flutter.io/technical-overview/ 5
Widgets
6https://flutter.io/technical-overview/
Widgets
• != Activity
• != Fragment
• Like View…
• …but unlike View
7https://flutter.io/widgets/
Widgets
8
main() {
runApp(
new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.green,
),
home: new Scaffold(
appBar: new AppBar(
title: new Text("Flutter Demo"),
),
body: new Text("Hello World!"),
),
),
);
https://flutter.io/widgets/
Stateless Widget
• Immutable views (widgets)
• Only one time is built
• Examples: Text, Icon, IconButton, etc.
9https://flutter.io/widgets/
Stateless Widget
10
new Text(
'Hello! How are you?',
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: new TextStyle(fontWeight: FontWeight.bold),
)
https://flutter.io/widgets/
Stateful Widget
• Still immutable, but…
• Contains State<W>
• Redraw after setState(() -> {}) call
• Examples: AppBar, Scaffold, TextField, etc.
11https://flutter.io/widgets/
Stateful widget
12
UI
Update State
User InputState
State
changes
Update state
e.g. button text
Rebuild widget
and update UI to
reflect changes
loadData() async {
String dataURL = "https://example.com/json";
http.Response response = await http.get(dataURL);
setState(() {
data = json.decode(response.body);
});
}
Async UI
13https://flutter.io/flutter-for-android/#async-ui
Layouts
14
Row
C
o
l
u
m
n
Column Stack
Co
lu
mn
…
ListView
Co
lu
mn
…
GridView
https://flutter.io/tutorials/layout/
Navigation
15https://flutter.io/flutter-for-android/#what-is-the-equivalent-of-an-intent-in-flutter
// Within the `FirstScreen` Widget
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new SecondScreen()),
);
}
// Within the SecondScreen Widget
onPressed: () {
Navigator.pop(context);
}
startActivityForResult
16
Map coordinates = await Navigator.of(context)
.push(…);
Navigator
.of(context)
.pop({"lat":43.821757,"long":-79.226392});
https://flutter.io/flutter-for-android/#what-is-the-equivalent-of-startactivityforresult
What does it mean for Android developers?
17
Android SDK Flutter
View / XML Widget
Activity / Fragment ~ State
Intent / FragmentManager (navigation) Navigator
Async UI async / await like JS or Kotlin coroutines
-dpi 1.0x, 2.0x, 3.0x
build.gradle pubspec.yaml
strings.xml static class Strings (till)
String resources
18
class Strings {
static String appName = "Flutter Demo";
static String hotels = "Hotels";
}
new MaterialApp(
title: Strings.appName,
theme: new ThemeData(
primaryColor: Colors.white,
),
home: new HotelsPage(),
),
Life cycle
19https://flutter.io/flutter-for-android/#how-do-i-listen-to-android-activity-lifecycle-events
AppLifecycleState
INACTIVE PAUSED RESUMED SUSPENDING
iOS only onPause() onPostResume()
onStop()
Android only
Platform
specific
code
20https://flutter.io/platform-channels/
Platform specific code
21
class _MyHomePageState extends State<MyHomePage> {
static const platform =
const MethodChannel('samples.flutter.io/battery');
// Get battery level.
String _batteryLevel = 'Unknown battery level.';
Future<Null> _getBatteryLevel() async {
String batteryLevel;
try {
final int result = await platform.invokeMethod('getBatteryLevel');
batteryLevel = 'Battery level at $result % .';
} on PlatformException catch (e) {
batteryLevel = "Failed to get battery level: '${e.message}'.";
}
setState(() {
_batteryLevel = batteryLevel;https://flutter.io/platform-channels/
Platform specific code
22
class MainActivity() : FlutterActivity() {
private val CHANNEL = "samples.flutter.io/battery"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
MethodChannel(flutterView, CHANNEL).setMethodCallHandler { call, result ->
// TODO
}
}
}
https://flutter.io/platform-channels/
Platform specific code
23
@Override
public void onMethodCall(MethodCall call, Result result) {
if (call.method.equals("getBatteryLevel")) {
int batteryLevel = getBatteryLevel();
if (batteryLevel != -1) {
result.success(batteryLevel);
} else {
result.error("UNAVAILABLE", "Battery level not available.", null);
}
} else {
result.notImplemented();
}
}
https://flutter.io/platform-channels/
Type casts
24https://flutter.io/platform-channels/
Architecture
25
• Widget - View (XML, View objects, Storyboard)
• State - Activity / Fragment / ViewController without PAIN
• Presentation / Model - Other OOP / Reactive / Functional
code
Environments
26
Flutter version 0.3.1 beta
Dart 2
Other topics
• Animation and transitions
• Themes
• Serialization
• Assets
• Internationalization
• Gestures
• About Dart
27https://flutter.io/docs/
Fuchsia OS
28
• Open-source OS by Google
• Magenta kernel
• Support’s Android apps
• Java
• Flutter apps are native
Sources
• Documentation - https://flutter.io/docs/
• Flutter - https://github.com/flutter/flutter
• https://github.com/Solido/awesome-flutter
• Plugins - https://github.com/flutter/plugins
• DI - https://github.com/google/inject.dart
• Free course - https://www.udacity.com/course/build-native-
mobile-apps-with-flutter--ud905
29
30
https://github.com/ParfenovVS/flutter_demo_hotels
@Vladimir_Parf
@parfenovvs
Flutter
Vladimir Parfenov
GDG SPB https://t.me/gdgspb
KUG SPB https://t.me/kug_spb
1 de 30

Recomendados

The magic of flutter por
The magic of flutterThe magic of flutter
The magic of flutterShady Selim
1.5K visualizações30 slides
Pune Flutter Presents - Flutter 101 por
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Arif Amirani
1.1K visualizações37 slides
Flutter talkshow por
Flutter talkshowFlutter talkshow
Flutter talkshowNhan Cao
831 visualizações37 slides
Flutter por
FlutterFlutter
FlutterAnkit Kumar
1.1K visualizações13 slides
Flutter por
FlutterFlutter
FlutterShyju Madathil
1.2K visualizações16 slides
Flutter workshop por
Flutter workshopFlutter workshop
Flutter workshopVishnu Suresh
11.2K visualizações31 slides

Mais conteúdo relacionado

Mais procurados

Building beautiful apps with Google flutter por
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutterAhmed Abu Eldahab
10.7K visualizações35 slides
Flutter por
FlutterFlutter
FlutterDave Chao
368 visualizações51 slides
Flutter por
FlutterFlutter
FlutterMohit Sharma
685 visualizações18 slides
Building beautiful apps using google flutter por
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutterAhmed Abu Eldahab
658 visualizações68 slides
Flutter introduction por
Flutter introductionFlutter introduction
Flutter introductionSheilaJimenezMorejon
453 visualizações11 slides
Introduction to Flutter - truly crossplatform, amazingly fast por
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
50.8K visualizações37 slides

Mais procurados(20)

Building beautiful apps with Google flutter por Ahmed Abu Eldahab
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutter
Ahmed Abu Eldahab10.7K visualizações
Flutter por Dave Chao
FlutterFlutter
Flutter
Dave Chao368 visualizações
Flutter por Mohit Sharma
FlutterFlutter
Flutter
Mohit Sharma685 visualizações
Building beautiful apps using google flutter por Ahmed Abu Eldahab
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutter
Ahmed Abu Eldahab658 visualizações
Introduction to Flutter - truly crossplatform, amazingly fast por Bartosz Kosarzycki
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
Bartosz Kosarzycki50.8K visualizações
Flutter Tutorial For Beginners | Edureka por Edureka!
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
Edureka!4.5K visualizações
Dart and Flutter Basics.pptx por DSCVSSUT
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptx
DSCVSSUT1.1K visualizações
Flutter por Mohit Nainwal
Flutter Flutter
Flutter
Mohit Nainwal388 visualizações
Flutter session 01 por DSC IEM
Flutter session 01Flutter session 01
Flutter session 01
DSC IEM490 visualizações
What is flutter and why should i care? por Sergi Martínez
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 Martínez6.1K visualizações
What and Why Flutter? What is a Widget in Flutter? por MohammadHussain595488
What and Why Flutter? What is a Widget in Flutter?What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?
MohammadHussain595488517 visualizações
Getting started with flutter por rihannakedy
Getting started with flutterGetting started with flutter
Getting started with flutter
rihannakedy1.4K visualizações
What is Flutter por Malan Amarasinghe
What is FlutterWhat is Flutter
What is Flutter
Malan Amarasinghe1.5K visualizações
Intro to Flutter SDK por digitaljoni
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
digitaljoni983 visualizações
Flutter introduction por Võ Duy Tuấn
Flutter introductionFlutter introduction
Flutter introduction
Võ Duy Tuấn1.2K visualizações
Flutter por shreyash singh
FlutterFlutter
Flutter
shreyash singh761 visualizações
Build beautiful native apps in record time with flutter por RobertLe30
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutter
RobertLe30303 visualizações
Introduction to flutter(1) por latifah alghanem
 Introduction to flutter(1) Introduction to flutter(1)
Introduction to flutter(1)
latifah alghanem171 visualizações

Similar a Flutter Intro

XamarinとAWSをつないでみた話 por
XamarinとAWSをつないでみた話XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話Takehito Tanabe
1.7K visualizações45 slides
Choose flutter por
Choose flutterChoose flutter
Choose flutterSamuelAdetunji2
67 visualizações49 slides
Flutter vs Java Graphical User Interface Frameworks.pptx por
Flutter vs Java Graphical User Interface Frameworks.pptx Flutter vs Java Graphical User Interface Frameworks.pptx
Flutter vs Java Graphical User Interface Frameworks.pptx Toma Velev
141 visualizações91 slides
[ABC2018Spring]Flutterアプリ開発入門 por
[ABC2018Spring]Flutterアプリ開発入門[ABC2018Spring]Flutterアプリ開発入門
[ABC2018Spring]Flutterアプリ開発入門Kenichi Kambara
3.8K visualizações80 slides
The 2016 Android Developer Toolbox [MOBILIZATION] por
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]Nilhcem
883 visualizações76 slides
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani por
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswanivvaswani
39.9K visualizações62 slides

Similar a Flutter Intro(20)

XamarinとAWSをつないでみた話 por Takehito Tanabe
XamarinとAWSをつないでみた話XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話
Takehito Tanabe1.7K visualizações
Choose flutter por SamuelAdetunji2
Choose flutterChoose flutter
Choose flutter
SamuelAdetunji267 visualizações
Flutter vs Java Graphical User Interface Frameworks.pptx por Toma Velev
Flutter vs Java Graphical User Interface Frameworks.pptx Flutter vs Java Graphical User Interface Frameworks.pptx
Flutter vs Java Graphical User Interface Frameworks.pptx
Toma Velev141 visualizações
[ABC2018Spring]Flutterアプリ開発入門 por Kenichi Kambara
[ABC2018Spring]Flutterアプリ開発入門[ABC2018Spring]Flutterアプリ開発入門
[ABC2018Spring]Flutterアプリ開発入門
Kenichi Kambara3.8K visualizações
The 2016 Android Developer Toolbox [MOBILIZATION] por Nilhcem
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]
Nilhcem883 visualizações
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani por vvaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
vvaswani39.9K visualizações
JavaScript APIs - The Web is the Platform por Robert Nyman
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the Platform
Robert Nyman5.4K visualizações
Introduction to flutter por 龍一郎 北野
Introduction to flutterIntroduction to flutter
Introduction to flutter
龍一郎 北野246 visualizações
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... por Robert Nyman
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Robert Nyman7K visualizações
HTML5 tutorial: canvas, offfline & sockets por Remy Sharp
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp6.7K visualizações
Great Developers Steal por Ben Scofield
Great Developers StealGreat Developers Steal
Great Developers Steal
Ben Scofield1.7K visualizações
AIR 開發應用程式實務 por angelliya00
AIR 開發應用程式實務AIR 開發應用程式實務
AIR 開發應用程式實務
angelliya00544 visualizações
Exploring Async PHP (SF Live Berlin 2019) por dantleech
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
dantleech483 visualizações
AFUP Lorraine - Symfony Webpack Encore por Engineor
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack Encore
Engineor356 visualizações
All a flutter about Flutter.io por Steven Cooper
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
Steven Cooper529 visualizações
Psgi Plack Sfpm por som_nangia
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
som_nangia1.8K visualizações
Psgi Plack Sfpm por wilburlo
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
wilburlo593 visualizações
soft-shake.ch - Hands on Node.js por soft-shake.ch
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
soft-shake.ch2.3K visualizações
Mobile HTML, CSS, and JavaScript por franksvalli
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
franksvalli104K visualizações
#Code2Create:: Introduction to App Development in Flutter with Dart por GDGKuwaitGoogleDevel
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
GDGKuwaitGoogleDevel212 visualizações

Último

Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... por
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...csegroupvn
5 visualizações210 slides
Final Year Presentation por
Final Year PresentationFinal Year Presentation
Final Year PresentationComsat Universal Islamabad Wah Campus
11 visualizações29 slides
Codes and Conventions.pptx por
Codes and Conventions.pptxCodes and Conventions.pptx
Codes and Conventions.pptxIsabellaGraceAnkers
13 visualizações5 slides
Pull down shoulder press final report docx (1).pdf por
Pull down shoulder press final report docx (1).pdfPull down shoulder press final report docx (1).pdf
Pull down shoulder press final report docx (1).pdfComsat Universal Islamabad Wah Campus
20 visualizações25 slides
Proposal Presentation.pptx por
Proposal Presentation.pptxProposal Presentation.pptx
Proposal Presentation.pptxkeytonallamon
52 visualizações36 slides
MSA Website Slideshow (16).pdf por
MSA Website Slideshow (16).pdfMSA Website Slideshow (16).pdf
MSA Website Slideshow (16).pdfmsaucla
92 visualizações8 slides

Último(20)

Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... por csegroupvn
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
csegroupvn5 visualizações
Codes and Conventions.pptx por IsabellaGraceAnkers
Codes and Conventions.pptxCodes and Conventions.pptx
Codes and Conventions.pptx
IsabellaGraceAnkers13 visualizações
Proposal Presentation.pptx por keytonallamon
Proposal Presentation.pptxProposal Presentation.pptx
Proposal Presentation.pptx
keytonallamon52 visualizações
MSA Website Slideshow (16).pdf por msaucla
MSA Website Slideshow (16).pdfMSA Website Slideshow (16).pdf
MSA Website Slideshow (16).pdf
msaucla92 visualizações
Effect of deep chemical mixing columns on properties of surrounding soft clay... por AltinKaradagli
Effect of deep chemical mixing columns on properties of surrounding soft clay...Effect of deep chemical mixing columns on properties of surrounding soft clay...
Effect of deep chemical mixing columns on properties of surrounding soft clay...
AltinKaradagli10 visualizações
MongoDB.pdf por ArthyR3
MongoDB.pdfMongoDB.pdf
MongoDB.pdf
ArthyR345 visualizações
REACTJS.pdf por ArthyR3
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR334 visualizações
SUMIT SQL PROJECT SUPERSTORE 1.pptx por Sumit Jadhav
SUMIT SQL PROJECT SUPERSTORE 1.pptxSUMIT SQL PROJECT SUPERSTORE 1.pptx
SUMIT SQL PROJECT SUPERSTORE 1.pptx
Sumit Jadhav 18 visualizações
Searching in Data Structure por raghavbirla63
Searching in Data StructureSearching in Data Structure
Searching in Data Structure
raghavbirla6314 visualizações
DevOps-ITverse-2023-IIT-DU.pptx por Anowar Hossain
DevOps-ITverse-2023-IIT-DU.pptxDevOps-ITverse-2023-IIT-DU.pptx
DevOps-ITverse-2023-IIT-DU.pptx
Anowar Hossain12 visualizações
Update 42 models(Diode/General ) in SPICE PARK(DEC2023) por Tsuyoshi Horigome
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Tsuyoshi Horigome38 visualizações
Investigation of Physicochemical Changes of Soft Clay around Deep Geopolymer ... por AltinKaradagli
Investigation of Physicochemical Changes of Soft Clay around Deep Geopolymer ...Investigation of Physicochemical Changes of Soft Clay around Deep Geopolymer ...
Investigation of Physicochemical Changes of Soft Clay around Deep Geopolymer ...
AltinKaradagli15 visualizações
LDPC_CODES.ppt por hsomashekar987
LDPC_CODES.pptLDPC_CODES.ppt
LDPC_CODES.ppt
hsomashekar98716 visualizações
Design of machine elements-UNIT 3.pptx por gopinathcreddy
Design of machine elements-UNIT 3.pptxDesign of machine elements-UNIT 3.pptx
Design of machine elements-UNIT 3.pptx
gopinathcreddy33 visualizações
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth por Innomantra
BCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for GrowthBCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for Growth
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth
Innomantra 6 visualizações
Design_Discover_Develop_Campaign.pptx por ShivanshSeth6
Design_Discover_Develop_Campaign.pptxDesign_Discover_Develop_Campaign.pptx
Design_Discover_Develop_Campaign.pptx
ShivanshSeth637 visualizações
Investor Presentation por eser sevinç
Investor PresentationInvestor Presentation
Investor Presentation
eser sevinç27 visualizações
Generative AI Models & Their Applications por SN
Generative AI Models & Their ApplicationsGenerative AI Models & Their Applications
Generative AI Models & Their Applications
SN10 visualizações

Flutter Intro