Introduction to flutter

Wan Muzaffar Wan Hashim
Wan Muzaffar Wan HashimMobile Development Corporate Trainer (iOS and Android) em Me-tech Solution Sdn Bhd
Introduction to Flutter
Developing a simple mobile app
By Wan Muzaffar Wan Hashim
Muzaffar
Founder of MDR-Tech, Co-founder of Anak2U
Worked with mobile industry since 2011
Different industry: M-Commerce, Newsfeed, Media Broadcasting, Food Delivery ,
Airline,Loyalty, Education.
2
Introduction to flutter
Introduction to flutter
Mobile App Development
● A mobile application is a software application designed to run on
smartphones, tablet computers and other mobile devices.
● Users on smartphones typically check the news, weather, email
or their social networks. They have a choice between the mobile
web version or a specially-created mobile app.
5
Mobile App Dev: Current State
Native Development Hybrid Development
● Android
● iOS
● Ionic
● React Native
● Flutter
● Native Script
● Xamarin
Mobile App
Types
● Native
○ Programmed using Swift/Objective C on the iPhone or
using Java/Kotlin on Android devices.
● Hybrid
○ Mix between these two types of mobile applications.
○ Normally based on web programming language, eg: HTML,
CSS, Javascript, Dart
○ Built once to be run on Android and iOS.
● Web Apps / Progressive Web Apps.
○ Web based.
Runs in the phone’s browser.
○ Can have native features based on HTML5
7
What is Flutter
Open source UI Framework by Google
Able to create iOS, Android and web application
using Dart
High performance, high fidelity, low latency, as it
renders the Native UI.
Use DART as main programming language
Open source / github.
About Dart
Dart is a programming language developed by
Google
Learning it isn’t hard if you have experience with
Java or JavaScript. You will quickly get it.
You can use dartpad as an online compiler of Dart
https://dartpad.dev/
Who uses Flutter
https://flutter.dev/showcase
Malaysia Google Trend (over 5 years)
Bridge gap between designer and developer - XD Flutter integration
Bridge gap between designer and developer - Supernova io
Setup your Editor
https://flutter.dev/docs/get-started/editor
You will need to configure an emulator after setting up the SDK.
Online Editor (Demo purposes - no setup)
https://codepen.io/pen/editor/flutter
Everything is a widget
You build widget upon widget.
Your screen, a section in a screen, a tiny little section is
also a Widget.
You create and customize your own widget.
Widget catalog
https://flutter.dev/docs/development/ui/widgets
The boilerplate code of an app - Scaffold
Scaffold(
appBar: AppBar(
title: const Text('Sample Code'),
),
body: Center(child: Text('Hello World')),
floatingActionButton: FloatingActionButton(
onPressed: () => {},
tooltip: 'Increment Counter',
child: const Icon(Icons.add),
),
);
Scaffold
A scaffold is a basic structure of an application having the following property by
default:
● appbar
● body
● floatingActionButton
● bottomNavigationBar
● drawer
Appbar
An app bar consists of a toolbar and
potentially other widgets,
For example, if you would like to add a
button on the left side you use leading and
actions on the right side.
You may change the property
backgroundColor to change the
background color of the AppBar.
Floating Action Button
A floating action button is a circular icon
button that hovers over content to promote
a primary action in the application
floatingActionButton:
FloatingActionButton(
onPressed: () {
// Add your onPressed code
here!
},
child: Icon(Icons.navigation),
backgroundColor:
Colors.green,
Body
This is where you build the content of your application.
Widgets for layouting
We will discover the widgets that are used to position items within a page. Here
are some important/main widgets:
● Container
● Center
● Column
● Row
● SingleChildScrollView
Container
Center(
child: Container(
margin: EdgeInsets.all(10.0),
color: Colors.amber[600],
width: 48.0,
height: 48.0,
padding:EdgeInsets.all(10.0)
),
A container is a box! You can specify the width, height, color, padding and margin.
In the below example, EdgeInsets.all means all direction (top, bottom, left, right)
Center
A widget that centers its child within itself.
Center(child: Text('Hello World')),
Row
A widget that displays its children in a horizontal array.
Row(
children: <Widget>[
Expanded(
child: Text('Deliver features faster', textAlign:
TextAlign.center),
),
Expanded(
child: Text('Craft beautiful UIs', textAlign:
TextAlign.center),
),
Expanded(
child: FittedBox(
fit: BoxFit.contain,
child: const FlutterLogo(),
),
),
],
Column
A widget that displays its children in a vertical
array.
Column(
children: <Widget>[
Text('Deliver features faster'),
Text('Craft beautiful UIs'),
Expanded(
child: FittedBox(
fit: BoxFit.contain,
child: const FlutterLogo(),
),
),
],
)
SingleScrollView
A box which allows a single widget to be scrolled.
You will use this when you have a single box that will normally be
entirely visible, for example a clock face in a time picker, but you need
to make sure it can be scrolled if the container gets too small in one
axis
Visible widget in Flutter
Once you know how to position items on a page, we will see some of the widgets
that you can use in your application. Here are some important/main widgets:
● Text
● Image
● Button
● Icon
● Slider
Text
Text(
'Hello World',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold,
color:Colors.red),
),
This widget is used to displays a text with
single style.
You might need to use TextStyle widget as
well with this widget to add styling to the
text, for example to add color, set to bold
Image
Image(
image:
NetworkImage('https://flutter.github.io/assets-for-api
-docs/assets/widgets/owl.jpg'),
)
To show an image. You may show an image
from:
● Downloaded from a URL
● Stored locally in assets folder
Icon
Icon(
Icons.audiotrack,
color: Colors.green,
size: 30.0,
),
As per its name, an icon is a widget that is
predefined, and can be used directly within
your application.
You may refer to Icon documentation, to see
all available icon ready to be used in your
application
https://api.flutter.dev/flutter/material/Icons-class.html
RaisedButton
RaisedButton(
child: Text('Color Changed'),
color: Colors.green,
onPressed: () {
print(“Hello World”)},
),
A raised button, follows Material
design principle is a button that
raises slightly, configurable via
elevation property.
You will need to declare what
should happen when the button is
pressed via it’s onPress property.
Other type of button includes
FlatButton
Slider
Slider(
value: _value.toDouble(),
min: 1.0,
max: 10.0,
onChanged: (double newValue) {
setState(() {
_value = newValue.round();
});
},
A slider can be used to select
from either a continuous or a
discrete set of values.
We will use onChanged property
to update the value of item, once
the value of slider changed.
Stateless Widget
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container()
}
}
Stateless Widget is a widget that
is immutable.
Stateless widgets cannot change
their state during the runtime of
the app, which means the
widgets cannot be redrawn while
the app is in action.
Stateful Widget
class MyWidget extends StatefulWidget {
@override
_MyWidget createState() => _MyWidget();
}
class _MyWidget extends State<MyWidget>{
@override
Widget build(BuildContext context){
return Container();
}
}
Stateful Widget is a widget that
stores variable (state).
This widget will rebuild itself
whenever there is a change of its
state (variable)
For example when user interact
with a button, you might change
the state/variable within the
widget => Widget will be
refreshed.
Demo - BMI Calculator
Demo
We will create a simple BMI calculator app that will calculate BMI based on height
and weight entered by user.
● An application using stateful widget since we are storing height, weight and
bmi
● Create the structure using scafffold
● Add Scrollview and container
● The container will contain a Column with:
○ Image (logo of our app)
○ App title and subtitle
● Two containers containing slider for user to choose height and weight
● Button when the button is pressed you will do the BMI calculation
BMI Calculator
Full source code can be found here: https://codepen.io/wanmuz86/pen/LYpBGej
Path to learn to build mobile app
● How to create UI element (focus on one page first)
● Navigation, multiple page = Stack, Tab, Drawer
● Passing data from one page to another page
● Retrieving data from Internet
● Storing data in local storage/Shared Preference
● Use device features : Camera, Geolocation, Social Sharing, Photo Library
● Improve architecture
● Finetune - Localization
Create a weather app using API from Open Weather that will show weather based
on Geolocation
Contact me
The Moose Academy
Common Room Bangi
Wan Muzaffar Wan Hashim (LinkedIn)
Notes
During the QnA Session I mistakenly quote price for Apple is 99USD per month, it
is actually 99USD per year.
iOS : 99 USD per year - Need a MAC or Rent macbook on cloud ->
Apple Developer Account
Android - 25 USD per life time -> PC or MAC -> Google Developer
Account
1 de 42

Recomendados

Flutter Intro por
Flutter IntroFlutter Intro
Flutter IntroVladimir Parfenov
7.4K visualizações30 slides
What is flutter and why should i care? por
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ínez
6.1K visualizações28 slides
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.6K visualizações35 slides
Introduction to Flutter por
Introduction to FlutterIntroduction to Flutter
Introduction to FlutterApoorv Pandey
573 visualizações27 slides
Flutter workshop por
Flutter workshopFlutter workshop
Flutter workshopVishnu Suresh
11.2K visualizações31 slides
Flutter por
FlutterFlutter
FlutterShyju Madathil
1.2K visualizações16 slides

Mais conteúdo relacionado

Mais procurados

Flutter por
FlutterFlutter
FlutterHimanshu Singh
26K visualizações26 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 talkshow por
Flutter talkshowFlutter talkshow
Flutter talkshowNhan Cao
830 visualizações37 slides
What is Flutter por
What is FlutterWhat is Flutter
What is FlutterMalan Amarasinghe
1.5K visualizações18 slides
Flutter Bootcamp por
Flutter BootcampFlutter Bootcamp
Flutter BootcampGoogle Developer Students Club NIT Silchar
426 visualizações26 slides
Flutter beyond hello world por
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello worldAhmed Abu Eldahab
2.7K visualizações61 slides

Mais procurados(20)

Flutter por Himanshu Singh
FlutterFlutter
Flutter
Himanshu Singh26K 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
Flutter talkshow por Nhan Cao
Flutter talkshowFlutter talkshow
Flutter talkshow
Nhan Cao830 visualizações
What is Flutter por Malan Amarasinghe
What is FlutterWhat is Flutter
What is Flutter
Malan Amarasinghe1.5K visualizações
Flutter beyond hello world por Ahmed Abu Eldahab
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
Ahmed Abu Eldahab2.7K visualizações
Getting started with flutter por rihannakedy
Getting started with flutterGetting started with flutter
Getting started with flutter
rihannakedy1.4K 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
RobertLe30302 visualizações
Flutter por Mohit Nainwal
Flutter Flutter
Flutter
Mohit Nainwal384 visualizações
Flutter Road Map.pptx por abdullahwale
Flutter Road Map.pptxFlutter Road Map.pptx
Flutter Road Map.pptx
abdullahwale59 visualizações
Flutter overview - advantages & disadvantages for business por Bartosz Kosarzycki
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
Bartosz Kosarzycki579 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?
MohammadHussain595488515 visualizações
Pune Flutter Presents - Flutter 101 por Arif Amirani
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
Arif Amirani1K 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
Developing Cross platform apps in flutter (Android, iOS, Web) por Priyanka Tyagi
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 Tyagi1.3K visualizações
Flutter workshop por Narayan Vyas
Flutter workshopFlutter workshop
Flutter workshop
Narayan Vyas205 visualizações
Flutter state management from zero to hero por Ahmed Abu Eldahab
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
Ahmed Abu Eldahab2.4K visualizações
Angular 8 por Sunil OS
Angular 8 Angular 8
Angular 8
Sunil OS531K 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
Introduction to kotlin por NAVER Engineering
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
NAVER Engineering5.6K visualizações

Similar a Introduction to flutter

Presentation por
PresentationPresentation
PresentationRajdeep Kaur
44 visualizações35 slides
04 objective-c session 4 por
04  objective-c session 404  objective-c session 4
04 objective-c session 4Amr Elghadban (AmrAngry)
138 visualizações31 slides
Resume_iOSDev por
Resume_iOSDevResume_iOSDev
Resume_iOSDevvishnu vardhan
127 visualizações7 slides
Introduction to android por
Introduction to androidIntroduction to android
Introduction to androidShrijan Tiwari
765 visualizações43 slides
Getting started with android studio por
Getting started with android studioGetting started with android studio
Getting started with android studioReham Maher El-Safarini
130 visualizações25 slides
Android Minnebar por
Android MinnebarAndroid Minnebar
Android MinnebarJustin Grammens
1.3K visualizações45 slides

Similar a Introduction to flutter (20)

Presentation por Rajdeep Kaur
PresentationPresentation
Presentation
Rajdeep Kaur44 visualizações
Resume_iOSDev por vishnu vardhan
Resume_iOSDevResume_iOSDev
Resume_iOSDev
vishnu vardhan127 visualizações
Introduction to android por Shrijan Tiwari
Introduction to androidIntroduction to android
Introduction to android
Shrijan Tiwari765 visualizações
Android Minnebar por Justin Grammens
Android MinnebarAndroid Minnebar
Android Minnebar
Justin Grammens1.3K visualizações
Android Lab Mannual 18SUITSP5.docx por karthikaparthasarath
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
karthikaparthasarath247 visualizações
Ap quiz app por angelicaurio
Ap quiz appAp quiz app
Ap quiz app
angelicaurio1.6K visualizações
hema ppt (2).pptx por balasekaran5
hema ppt (2).pptxhema ppt (2).pptx
hema ppt (2).pptx
balasekaran516 visualizações
Android Bootcamp Tanzania:understanding ui in_android por Denis Minja
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
Denis Minja1.1K visualizações
pebble - Building apps on pebble por Aniruddha Chakrabarti
pebble - Building apps on pebblepebble - Building apps on pebble
pebble - Building apps on pebble
Aniruddha Chakrabarti854 visualizações
Web application development process por John Smith
Web application development processWeb application development process
Web application development process
John Smith59 visualizações
Unity Game Engine - Basics por FirosK2
Unity Game Engine - BasicsUnity Game Engine - Basics
Unity Game Engine - Basics
FirosK2187 visualizações
CS6611 Mobile Application Development Lab Manual-2018-19 por Gobinath Subramaniam
CS6611 Mobile Application Development Lab Manual-2018-19CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19
Gobinath Subramaniam7K visualizações
UNIT CONVERTER por Nishita Kaptak
UNIT CONVERTERUNIT CONVERTER
UNIT CONVERTER
Nishita Kaptak2.7K visualizações
Basic android development por Upanya Singh
Basic android developmentBasic android development
Basic android development
Upanya Singh582 visualizações
Basic android development por Upanya Singh
Basic android developmentBasic android development
Basic android development
Upanya Singh1.3K visualizações
ResumeMobileApp2016 1 por vishnu vardhan
ResumeMobileApp2016 1ResumeMobileApp2016 1
ResumeMobileApp2016 1
vishnu vardhan155 visualizações

Último

Navigating container technology for enhanced security by Niklas Saari por
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
12 visualizações34 slides
DevsRank por
DevsRankDevsRank
DevsRankdevsrank786
11 visualizações1 slide
Cycleops - Automate deployments on top of bare metal.pptx por
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptxThanassis Parathyras
31 visualizações12 slides
360 graden fabriek por
360 graden fabriek360 graden fabriek
360 graden fabriekinfo33492
36 visualizações25 slides
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM... por
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...Deltares
7 visualizações40 slides
Software evolution understanding: Automatic extraction of software identifier... por
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...Ra'Fat Al-Msie'deen
7 visualizações33 slides

Último(20)

Navigating container technology for enhanced security by Niklas Saari por Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy12 visualizações
DevsRank por devsrank786
DevsRankDevsRank
DevsRank
devsrank78611 visualizações
Cycleops - Automate deployments on top of bare metal.pptx por Thanassis Parathyras
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptx
Thanassis Parathyras31 visualizações
360 graden fabriek por info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info3349236 visualizações
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM... por Deltares
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
Deltares7 visualizações
Software evolution understanding: Automatic extraction of software identifier... por Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Ra'Fat Al-Msie'deen7 visualizações
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema por Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 visualizações
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... por Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 visualizações
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols por Deltares
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
Deltares7 visualizações
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... por Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 visualizações
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... por Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares10 visualizações
MariaDB stored procedures and why they should be improved por Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
Federico Razzoli8 visualizações
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... por Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares12 visualizações
Neo4j y GenAI por Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j45 visualizações
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... por Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 visualizações
A first look at MariaDB 11.x features and ideas on how to use them por Federico Razzoli
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use them
Federico Razzoli45 visualizações
Advanced API Mocking Techniques por Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 visualizações
El Arte de lo Possible por Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j39 visualizações
Software testing company in India.pptx por SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 visualizações

Introduction to flutter

  • 1. Introduction to Flutter Developing a simple mobile app By Wan Muzaffar Wan Hashim
  • 2. Muzaffar Founder of MDR-Tech, Co-founder of Anak2U Worked with mobile industry since 2011 Different industry: M-Commerce, Newsfeed, Media Broadcasting, Food Delivery , Airline,Loyalty, Education. 2
  • 5. Mobile App Development ● A mobile application is a software application designed to run on smartphones, tablet computers and other mobile devices. ● Users on smartphones typically check the news, weather, email or their social networks. They have a choice between the mobile web version or a specially-created mobile app. 5
  • 6. Mobile App Dev: Current State Native Development Hybrid Development ● Android ● iOS ● Ionic ● React Native ● Flutter ● Native Script ● Xamarin
  • 7. Mobile App Types ● Native ○ Programmed using Swift/Objective C on the iPhone or using Java/Kotlin on Android devices. ● Hybrid ○ Mix between these two types of mobile applications. ○ Normally based on web programming language, eg: HTML, CSS, Javascript, Dart ○ Built once to be run on Android and iOS. ● Web Apps / Progressive Web Apps. ○ Web based. Runs in the phone’s browser. ○ Can have native features based on HTML5 7
  • 8. What is Flutter Open source UI Framework by Google Able to create iOS, Android and web application using Dart High performance, high fidelity, low latency, as it renders the Native UI. Use DART as main programming language Open source / github.
  • 9. About Dart Dart is a programming language developed by Google Learning it isn’t hard if you have experience with Java or JavaScript. You will quickly get it. You can use dartpad as an online compiler of Dart https://dartpad.dev/
  • 11. Malaysia Google Trend (over 5 years)
  • 12. Bridge gap between designer and developer - XD Flutter integration
  • 13. Bridge gap between designer and developer - Supernova io
  • 14. Setup your Editor https://flutter.dev/docs/get-started/editor You will need to configure an emulator after setting up the SDK.
  • 15. Online Editor (Demo purposes - no setup) https://codepen.io/pen/editor/flutter
  • 16. Everything is a widget You build widget upon widget. Your screen, a section in a screen, a tiny little section is also a Widget. You create and customize your own widget.
  • 18. The boilerplate code of an app - Scaffold Scaffold( appBar: AppBar( title: const Text('Sample Code'), ), body: Center(child: Text('Hello World')), floatingActionButton: FloatingActionButton( onPressed: () => {}, tooltip: 'Increment Counter', child: const Icon(Icons.add), ), );
  • 19. Scaffold A scaffold is a basic structure of an application having the following property by default: ● appbar ● body ● floatingActionButton ● bottomNavigationBar ● drawer
  • 20. Appbar An app bar consists of a toolbar and potentially other widgets, For example, if you would like to add a button on the left side you use leading and actions on the right side. You may change the property backgroundColor to change the background color of the AppBar.
  • 21. Floating Action Button A floating action button is a circular icon button that hovers over content to promote a primary action in the application floatingActionButton: FloatingActionButton( onPressed: () { // Add your onPressed code here! }, child: Icon(Icons.navigation), backgroundColor: Colors.green,
  • 22. Body This is where you build the content of your application.
  • 23. Widgets for layouting We will discover the widgets that are used to position items within a page. Here are some important/main widgets: ● Container ● Center ● Column ● Row ● SingleChildScrollView
  • 24. Container Center( child: Container( margin: EdgeInsets.all(10.0), color: Colors.amber[600], width: 48.0, height: 48.0, padding:EdgeInsets.all(10.0) ), A container is a box! You can specify the width, height, color, padding and margin. In the below example, EdgeInsets.all means all direction (top, bottom, left, right)
  • 25. Center A widget that centers its child within itself. Center(child: Text('Hello World')),
  • 26. Row A widget that displays its children in a horizontal array. Row( children: <Widget>[ Expanded( child: Text('Deliver features faster', textAlign: TextAlign.center), ), Expanded( child: Text('Craft beautiful UIs', textAlign: TextAlign.center), ), Expanded( child: FittedBox( fit: BoxFit.contain, child: const FlutterLogo(), ), ), ],
  • 27. Column A widget that displays its children in a vertical array. Column( children: <Widget>[ Text('Deliver features faster'), Text('Craft beautiful UIs'), Expanded( child: FittedBox( fit: BoxFit.contain, child: const FlutterLogo(), ), ), ], )
  • 28. SingleScrollView A box which allows a single widget to be scrolled. You will use this when you have a single box that will normally be entirely visible, for example a clock face in a time picker, but you need to make sure it can be scrolled if the container gets too small in one axis
  • 29. Visible widget in Flutter Once you know how to position items on a page, we will see some of the widgets that you can use in your application. Here are some important/main widgets: ● Text ● Image ● Button ● Icon ● Slider
  • 30. Text Text( 'Hello World', textAlign: TextAlign.center, style: TextStyle(fontWeight: FontWeight.bold, color:Colors.red), ), This widget is used to displays a text with single style. You might need to use TextStyle widget as well with this widget to add styling to the text, for example to add color, set to bold
  • 31. Image Image( image: NetworkImage('https://flutter.github.io/assets-for-api -docs/assets/widgets/owl.jpg'), ) To show an image. You may show an image from: ● Downloaded from a URL ● Stored locally in assets folder
  • 32. Icon Icon( Icons.audiotrack, color: Colors.green, size: 30.0, ), As per its name, an icon is a widget that is predefined, and can be used directly within your application. You may refer to Icon documentation, to see all available icon ready to be used in your application https://api.flutter.dev/flutter/material/Icons-class.html
  • 33. RaisedButton RaisedButton( child: Text('Color Changed'), color: Colors.green, onPressed: () { print(“Hello World”)}, ), A raised button, follows Material design principle is a button that raises slightly, configurable via elevation property. You will need to declare what should happen when the button is pressed via it’s onPress property. Other type of button includes FlatButton
  • 34. Slider Slider( value: _value.toDouble(), min: 1.0, max: 10.0, onChanged: (double newValue) { setState(() { _value = newValue.round(); }); }, A slider can be used to select from either a continuous or a discrete set of values. We will use onChanged property to update the value of item, once the value of slider changed.
  • 35. Stateless Widget class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Container() } } Stateless Widget is a widget that is immutable. Stateless widgets cannot change their state during the runtime of the app, which means the widgets cannot be redrawn while the app is in action.
  • 36. Stateful Widget class MyWidget extends StatefulWidget { @override _MyWidget createState() => _MyWidget(); } class _MyWidget extends State<MyWidget>{ @override Widget build(BuildContext context){ return Container(); } } Stateful Widget is a widget that stores variable (state). This widget will rebuild itself whenever there is a change of its state (variable) For example when user interact with a button, you might change the state/variable within the widget => Widget will be refreshed.
  • 37. Demo - BMI Calculator
  • 38. Demo We will create a simple BMI calculator app that will calculate BMI based on height and weight entered by user. ● An application using stateful widget since we are storing height, weight and bmi ● Create the structure using scafffold ● Add Scrollview and container ● The container will contain a Column with: ○ Image (logo of our app) ○ App title and subtitle ● Two containers containing slider for user to choose height and weight ● Button when the button is pressed you will do the BMI calculation
  • 39. BMI Calculator Full source code can be found here: https://codepen.io/wanmuz86/pen/LYpBGej
  • 40. Path to learn to build mobile app ● How to create UI element (focus on one page first) ● Navigation, multiple page = Stack, Tab, Drawer ● Passing data from one page to another page ● Retrieving data from Internet ● Storing data in local storage/Shared Preference ● Use device features : Camera, Geolocation, Social Sharing, Photo Library ● Improve architecture ● Finetune - Localization Create a weather app using API from Open Weather that will show weather based on Geolocation
  • 41. Contact me The Moose Academy Common Room Bangi Wan Muzaffar Wan Hashim (LinkedIn)
  • 42. Notes During the QnA Session I mistakenly quote price for Apple is 99USD per month, it is actually 99USD per year. iOS : 99 USD per year - Need a MAC or Rent macbook on cloud -> Apple Developer Account Android - 25 USD per life time -> PC or MAC -> Google Developer Account