Flutter Workshop 2021
25-26 January 2021
Phranakhon Si Ayutthaya Rajabhat University
Link
● Git repository (http://bit.ly/flutter_aru_2021_code)
● Presentation (http://bit.ly/flutter_aru_2021_slide)
● Youtube (http://bit.ly/flutter_aru_2021_video)
● Google Meet (https://meet.google.com/erx-pdof-pgc)
Who am I?
● Former senior software engineer - Software Industry Promotion Agency
● Former technical team leader - IoT and Digital Innovation Institue / DEPA
● Former Content writer - thaiopensource.org
● Cloud computing and IoT consultant
● Content creater - Facebook page Dart แบบ Dart Dart
Flutter is UX Toolkit to make a
mobile, web, desktop application.
Flutter made by Google inc.
Create your first app
Main method
Root widget
Home widget / Home screen
Let’s run your app
Create more pages
Create a folders for easy organized your files eg:
● pages
● services
● models
Create page with a blank container
Widget Tree
MaterialApp
Scaffold
AppBar
Text
Body
Basic navigation
Travel Guide UI Design
* See more detail in XD file
Screen Layout & Custom Widget
Tips
Draw a box to separate
segment and draw a box
again to identify widget.
Row
- Text
- Spacer
- CircularAvatar
- Icon
Container
- Row
- Icon
- TextEditField
Column
- Image
- Text
- Text
ListView (Horizontal)
- Column
- Image
- Text
- Text
GirdView
- Column
- Image
- Text
- Text
ListView
- Column
- Row
- Icon
- Text
- Stack
- Image
- Pisitioned
- Column
- Text
- Text
Let’s Code!!!
(Example 03)
Let’s connect to Firebase
Firebase
Build Release & Monitor Engage
Link - https://firebase.google.com
● Cloud Firestore
● Machine Learning
● Cloud Functions
● Authentication
● Hosting
● Cloud Storage
● Realtime Database
● Crashlytics
● Performance Monitoring
● Test Lab
● App Distribution
● In-App Messaging
● Google Analytics
● Predictions
● A/B Testing
● Cloud Messaging
● Remote Config
● Dynamic Links
Create your project
Firebase billing plans
FlutterFire
Link - https://firebase.flutter.dev
Design your NoSQL Document
1. Cloud Firestore is NoSQL database
2. A Limit in query and not support full-text search
3. A limit in index MUST design your document properly
4. Read, Write, Snapshot is cost so design your document properly
Design NoSQL Document #1
●
●
●
●
●
●
Single collection separate trip with user
but hard to query city and country
Design NoSQL Document #2
●
●
●
●
●
●
●
●
●
●
●
●
Separate into 2 collection user and trip easy to query user data but still hard to query city and country
Design NoSQL Document #3
●
●
●
●
●
●
Separate into 3 collections user, trip, city. It easy to query user data, trip city but should have problem
data intrigity when delete city data (may use Cloud Function to handle this)
●
●
●
●
●
●
●
●
Cloud Firestore Query
Link - https://www.youtube.com/watch?v=WacqhiI-g_o&list=PLl-K7zZEsYLlP-k-RKFa7RyNPa9_wCH2s
Cloud Firestore Query
Add data to collection with random document id
…
Cloud Firestore Query
Add data to collection with specify document id
…
Cloud Firestore Query
Update data
Cloud Firestore Query
Delete document by specify document id
Cloud Firestore Query
Get document directly with document id, eg:
Or
Cloud Firestore Query
Get the list of document in collection eg:
You can use where, orderby, limit etc to filter your data.
Cloud Firestore Query
Get snapshot
Cloud Firestore NO Full Text Search T_T
Firebase is no full text search aka LIKE in SQL command. You MUST use 3rt party
service like Algolia, Elasticsearch or RDB.
Let’s Code!!!
(Example 05)
Don’t forget
● Register your Firebase account
● Register your project and debug keystore
● Copy google-service.json to android/app directory
● Add mockup data
● Complete trip detail and search page (search page, use list.contain for
search)
Firebase Authentication
Sign In Method
UI Cheat Sheet
App with transparent status bar
Remove debug banner
Google Font
Custom AppBar
Rounded rectangle Container
Image with Clip in Rounded rectangle
Image with Clip in CardView
ListView Item (1/2)
ListView Item (2/2)
Horizontal ListView
GridView with child aspect ratio
Stack
Search Bar (Container + Text Field)
Color Gradient
Cached Network Image
Form
Dropdown List

Flutter Workshop 2021 @ ARU