SlideShare una empresa de Scribd logo
1 de 168
Descargar para leer sin conexión
Who am I?
● Former
○ Product manager @ Trilex Network
○ Software Engineer @ Software Industry Promotion Agency
○ Team Leader @ Digital Park Thailand
○ Team Leader @ IoT and Digital Innovation Institute, DEPA
○ Content creator @ Thaiopensource.org
● Present
○ A cat slave
○ A Traveler in Teyvat
Flutter is Google’s UI toolkit for building
beautiful, natively compiled applications for
mobile, web, and desktop from a single
codebase.
Get Started
Let’s use Flutter Doctor
flutter doctor
Show more detail
flutter doctor -v
Use mobile phone or simulator
Check connected devices
flutter devices
Create new project
flutter create helloworld
Project structure
Create with package name
flutter create --org com.awesome helloworld
Visual Studio Code
install more plugins
1st
run your app
flutter run -d your-device-id
01_helloworld
Workshop 01
Create expense management application and run in your mobile phone or
simulator
flutter create --org com.awesome expense
03_expense
Start with main() and runApp
Everything in Flutter is widget
Clear all MyHomePage widget
and create 2 new widget
Use snippet for create stateful widget
just type statefulW
First Page
Second Page
Change MyHomePage to FirstPage
Run your app and test navigation
02_page_navigation
Let’s see Observatory debugger
Workshop 02
● Create folder for pages
● Create dart file call home.dart for home page
03_expense
Custom Theme
04_custom_theme
Center Widget
05_center_text
Button Widget
06_button
Column Widget
07_column
Padding Widget
08_padding
Row Widget
09_row
SizedBox Widget
10_sizedbox
Expanded Widget
11_expanded
ListView Widget
12_listview
GridView Widget
13_gridview
CardView Widget
14_cardview
Stack Widget
15_custom_widget
Create your own widget
15_custom_widget
FAB Widget
16_fab
Workshop 03
● Create all page with custom widget
● see UI and UI flow in XD file
17_expense_full_widget
Bottom Navigation Bar
20_form_validation
Navigation Drawer
Workshop 04
● Add bottom navigation and navigation drawer
● UI and UI flow in XD file
21_expense_navigation
Form & Input Validation
20_form_validation
Workshop 05
● Create sign in and sign up page with input validation
● UI and UI flow in XD file
MOOR ⇔ ROOM
Moor
Add dependencies
● path: ^1.7.0
● path_provider: ^1.6.21
● provider: ^4.3.2+2
● sqlite3_flutter_libs: ^0.2.0
● moor_flutter: ^3.1.0
Moor - https://moor.simonbinder.eu/docs/
Moor
Add dev dependencies
● build_runner: null
● moor_generator: ^3.3.1
Moor
Declare tables and query
Moor
Generate code in cli
flutter packages pub run build_runner build
OR watch and build
flutter packages pub run build_runner watch
Workshop 6
● Write a Todo app
22_moor_sqlite
Shared Preferences
Shared Preferences
● Add plugin shared_preferences to your project
● Use shared preference to store key-value data
Shared Preference - https://pub.dev/packages/shared_preferences
Workshop 7
● Write profile page
● Save username and avatar path to shared preferences
23_sharedpreferences
Connect to REST API
REST API
Http request method GET, PUT, POST, DELETE to perform action to your resource.
http://127.0.0.1/api/v1/user
REST API
GET PUT POST DELETE
/user Get all user Add new user Add new user Delete all user
/user/1 Get user
Id = 1
Update user
Id = 1
Delete user
id = 1
Request methods
REST API
Sample http status code
● 200 Ok
● 201 Created
● 400 Bad request
● 401 Unauthorized
● 403 Forbidden
● 404 Not found
REST API Status code - https://restfulapi.net/http-status-codes
Http client plugin
● Http
● Dio
● Retrofit ***
● Chopper
Json2DartClass -> https://javiercbk.github.io/json_to_dart
http
● Add http plugin to your pubspec.yaml
● Test your endpoint eg: Swagger, Postman, Insomnia etc
● Write a service call according to your request
● Merge your request to widget in Flutter
Cookbook Networking -> https://flutter.dev/docs/cookbook#networking
Retrofit
1. Add dependency
● dio: ^3.0.10
● json_annotation: ^3.1.0
● retrofit: ^1.3.4+1
Retrofit - https://pub.dev/packages/retrofit
Retrofit
2. Add dev dependency
● build_runner: ^1.10.3
● retrofit_generator: ^1.4.0
Retrofit
3. Create rest client and model class
1. RestClient
2. Model
Use build_runner to generate code
flutter packages pub run build_runner build
Call REST API with RestClient
24_todo_api
Workshop 8
● Todo List app connect to your backend
25_retrofit_provider
Flutter workshop @ bang saen 2020

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Introduction to flutter
Introduction to flutterIntroduction to flutter
Introduction to flutter
 
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)
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
 
All a flutter about Flutter.io
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
 
Flutter for web
Flutter for webFlutter for web
Flutter for web
 
Flutter
FlutterFlutter
Flutter
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
Flutter dart assignment help
Flutter dart assignment helpFlutter dart assignment help
Flutter dart assignment help
 
Flutter
FlutterFlutter
Flutter
 
Flutter - DevFestDC
Flutter - DevFestDCFlutter - DevFestDC
Flutter - DevFestDC
 
Flutter bus 2018
Flutter bus 2018Flutter bus 2018
Flutter bus 2018
 
Flutter for web
Flutter for web Flutter for web
Flutter for web
 
Flutter
Flutter Flutter
Flutter
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
Flutter UI Framework
Flutter UI FrameworkFlutter UI Framework
Flutter UI Framework
 
Build beautiful native apps in record time with flutter
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
 
Mobile development with Flutter
Mobile development with FlutterMobile development with Flutter
Mobile development with Flutter
 
Flutter vs React Native
Flutter vs React NativeFlutter vs React Native
Flutter vs React Native
 
Introduction to flutter(1)
 Introduction to flutter(1) Introduction to flutter(1)
Introduction to flutter(1)
 
Flutter Development Services
Flutter Development ServicesFlutter Development Services
Flutter Development Services
 

Similar a Flutter workshop @ bang saen 2020

GoogleDSC_ GHRCE_ flutter_firebase.pptx
GoogleDSC_ GHRCE_  flutter_firebase.pptxGoogleDSC_ GHRCE_  flutter_firebase.pptx
GoogleDSC_ GHRCE_ flutter_firebase.pptx
GoogleDeveloperStude22
 

Similar a Flutter workshop @ bang saen 2020 (20)

Ahmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICDAhmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICD
 
Use open source software to develop ideas at work
Use open source software to develop ideas at workUse open source software to develop ideas at work
Use open source software to develop ideas at work
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application Packages
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
 
GoogleDSC_ GHRCE_ flutter_firebase.pptx
GoogleDSC_ GHRCE_  flutter_firebase.pptxGoogleDSC_ GHRCE_  flutter_firebase.pptx
GoogleDSC_ GHRCE_ flutter_firebase.pptx
 
30 days of cloud - 1
30 days of cloud - 130 days of cloud - 1
30 days of cloud - 1
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
MuleSoft Meetup Bangalore - March 6 2021
MuleSoft Meetup Bangalore - March 6 2021MuleSoft Meetup Bangalore - March 6 2021
MuleSoft Meetup Bangalore - March 6 2021
 
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
 
Flutter festival gdsc juet guna
Flutter festival   gdsc juet gunaFlutter festival   gdsc juet guna
Flutter festival gdsc juet guna
 
DevOps Automation with Puppet Bolt & Puppet Enterprise
DevOps Automation with Puppet Bolt & Puppet EnterpriseDevOps Automation with Puppet Bolt & Puppet Enterprise
DevOps Automation with Puppet Bolt & Puppet Enterprise
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
Indianapolis_meetup_April-1st-2022.pptx
Indianapolis_meetup_April-1st-2022.pptxIndianapolis_meetup_April-1st-2022.pptx
Indianapolis_meetup_April-1st-2022.pptx
 
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptxMuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Building A Self-Documenting Application: A Study in Chef and Compliance
Building A Self-Documenting Application: A Study in Chef and ComplianceBuilding A Self-Documenting Application: A Study in Chef and Compliance
Building A Self-Documenting Application: A Study in Chef and Compliance
 

Más de Anuchit Chalothorn

Más de Anuchit Chalothorn (20)

13 web service integration
13 web service integration13 web service integration
13 web service integration
 
09 material design
09 material design09 material design
09 material design
 
07 intent
07 intent07 intent
07 intent
 
05 binding and action
05 binding and action05 binding and action
05 binding and action
 
04 layout design and basic widget
04 layout design and basic widget04 layout design and basic widget
04 layout design and basic widget
 
03 activity life cycle
03 activity life cycle03 activity life cycle
03 activity life cycle
 
02 create your first app
02 create your first app02 create your first app
02 create your first app
 
01 introduction
01 introduction 01 introduction
01 introduction
 
Material Theme
Material ThemeMaterial Theme
Material Theme
 
00 Android Wear Setup Emulator
00 Android Wear Setup Emulator00 Android Wear Setup Emulator
00 Android Wear Setup Emulator
 
MongoDB Replication Cluster
MongoDB Replication ClusterMongoDB Replication Cluster
MongoDB Replication Cluster
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
IT Automation with Puppet Enterprise
IT Automation with Puppet EnterpriseIT Automation with Puppet Enterprise
IT Automation with Puppet Enterprise
 
Using PhoneGap Command Line
Using PhoneGap Command LineUsing PhoneGap Command Line
Using PhoneGap Command Line
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
OpenStack Cheat Sheet V2
OpenStack Cheat Sheet V2OpenStack Cheat Sheet V2
OpenStack Cheat Sheet V2
 
REST API with CakePHP
REST API with CakePHPREST API with CakePHP
REST API with CakePHP
 
Open Stack Cheat Sheet V1
Open Stack Cheat Sheet V1Open Stack Cheat Sheet V1
Open Stack Cheat Sheet V1
 
Btf2013 OpenShift Live Demo
Btf2013 OpenShift Live DemoBtf2013 OpenShift Live Demo
Btf2013 OpenShift Live Demo
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Flutter workshop @ bang saen 2020