Slide 1

Slide 1 text

Dhrumil Shah, Shipmnts & GDG Ahmedabad @dhuma1981 Jalandhar Let’s explore Flutter with Firebase

Slide 2

Slide 2 text

Dhrumil Shah Mobile Developer, @Shipmnts Co-organizer, @GDGAhmedabad Founder, @Flutter_Flakes

Slide 3

Slide 3 text

Let’s start with Jalandhar

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

How Flutter is different?

Slide 6

Slide 6 text

Compiled to native MVC/ MVVM View Reactive Views Interpreted (JavaScript) iOS SDK Android SDK Technology: OEM SDKs

Slide 7

Slide 7 text

Compiled to native MVC/ MVVM View Reactive Views Interpreted (JavaScript) iOS SDK Android SDK Titanium, Cordova, PhoneGap, Ionic, ... Technology: WebViews

Slide 8

Slide 8 text

Compiled to native MVC/ MVVM View Reactive Views Interpreted (JavaScript) iOS SDK Android SDK Titanium, Cordova, PhoneGap, Ionic, ... Flutter React Native Technology: Reactive Views

Slide 9

Slide 9 text

“Everything is Widget”

Slide 10

Slide 10 text

A Widget can be defined as Jalandhar ● A structural element ○ e.g. Button, TextView, Menu ● A design element ○ e.g. Font or Color ● A layout element ○ e.g. Margin or Padding ● Or even a business logic

Slide 11

Slide 11 text

Jalandhar The app itself is a Widget

Slide 12

Slide 12 text

Jalandhar The app itself is a Widget

Slide 13

Slide 13 text

Jalandhar The app itself is a Widget

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

“Stateless Widget vs Stateful Widget”

Slide 16

Slide 16 text

Stateless Widget Jalandhar ● Dumb Widget ● It doesn’t know anything ● Gets render only once or ● When the parent widget changes the configuration

Slide 17

Slide 17 text

Stateful Widget Jalandhar ● Dynamic widget which has its own properties ● Those property is know as state of the widget ● The state of the widget can be changed by user input, any operation or other widget’s state change. ● setState() method is used to change the state. ● Each time widget gets rebuild when setState() method gets called.

Slide 18

Slide 18 text

Let’s see it in Action

Slide 19

Slide 19 text

Speaker List App

Slide 20

Slide 20 text

Speaker List App... ● Basic Requirement ○ AppBar ○ ListView ○ Text

Slide 21

Slide 21 text

Speaker List App... ● Let’s Start

Slide 22

Slide 22 text

Speaker List App... ● Add Scaffold with AppBar

Slide 23

Slide 23 text

Speaker List App... ● Create Speakers Array

Slide 24

Slide 24 text

Speaker List App... ● Create Listview with Speaker’s Name

Slide 25

Slide 25 text

Speaker List App... ● Wrap Text with ListTile Widget

Slide 26

Slide 26 text

Speaker List App... ● Let’s add claps count in trailing

Slide 27

Slide 27 text

Speaker List App... ● Let’s add border using Container & BoxDecoration widget

Slide 28

Slide 28 text

Speaker List App... ● Let’s make it circular border

Slide 29

Slide 29 text

Speaker List App... ● We need to add some padding. ● For that we have Padding widget & we will wrap our Container Widget to Padding Widget

Slide 30

Slide 30 text

Speaker List App :) ● Widgets we used ○ MaterialApp ○ Scaffold ○ AppBar ○ Text ○ ListView ○ ListTile ○ Padding ○ Container ○ BoxDecoration ○ Border ○ BorderRadius

Slide 31

Slide 31 text

Futter benefits ● Easy to understand ● Less Time consuming ● Code Length: ~50 line of code ● And you get iOS app free

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Wait… This is just static data

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

We need something simple and as fast as Flutter

Slide 36

Slide 36 text

We have Jalandhar

Slide 37

Slide 37 text

Firebase helps you to Jalandhar ● “Build” Better Apps ● “Improve” app quality ● “Grow” your business

Slide 38

Slide 38 text

Firebase - “Build” better apps Jalandhar ● Realtime Database ○ Cloud Firestore (Beta) ● Authentication ● ML Kit(Beta) ● Hosting ● Cloud Storage ● Cloud Functions

Slide 39

Slide 39 text

Firebase - “Improve” app quality Jalandhar ● Crashlytics ● Performance Monitoring ● Test Lab

Slide 40

Slide 40 text

Firebase - “Grow” your business Jalandhar ● Google analytics ● Cloud messaging ● Dynamic links ● Remote config ● App indexing ● Test Lab ● A/B Testing (Beta) ● Predictions (Beta)

Slide 41

Slide 41 text

Firebase for Flutter

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Let’s make our Speaker List app more useful with Firebase

Slide 44

Slide 44 text

Firebase console Jalandhar ● Open Firebase console ● Create new app ● Integrate platform specific code ● For Android: Download google-services.json file ● For iOS: GoogleService-Info.plist

Slide 45

Slide 45 text

Create Cloud FireStore Database and add data Jalandhar

Slide 46

Slide 46 text

First let’s make code more readable Jalandhar

Slide 47

Slide 47 text

First let’s make code more readable Jalandhar

Slide 48

Slide 48 text

First let’s make code more readable Jalandhar

Slide 49

Slide 49 text

First let’s make code more readable Jalandhar

Slide 50

Slide 50 text

First let’s make code more readable Jalandhar

Slide 51

Slide 51 text

First let’s make code more readable Jalandhar

Slide 52

Slide 52 text

First let’s make code more readable Jalandhar

Slide 53

Slide 53 text

Integration of Cloud FireStore ● Open “pubspec.yaml” and add the dependency as shown

Slide 54

Slide 54 text

Cloud Firestore integration Jalandhar OLD CODE

Slide 55

Slide 55 text

Cloud Firestore integration Jalandhar

Slide 56

Slide 56 text

Cloud Firestore integration Jalandhar

Slide 57

Slide 57 text

Cloud Firestore integration Jalandhar

Slide 58

Slide 58 text

Cloud Firestore integration Jalandhar

Slide 59

Slide 59 text

Cloud Firestore integration Jalandhar

Slide 60

Slide 60 text

Now we can read data from Firebase Jalandhar

Slide 61

Slide 61 text

Let’s write data to Firebase Jalandhar

Slide 62

Slide 62 text

And That’s it

Slide 63

Slide 63 text

● We changed maximum 7-9 lines and Firebase Cloud FireStore is integrated :)

Slide 64

Slide 64 text

See you tomorrow to develop app using ;) Jalandhar

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

Dhrumil Shah, Shipmnts & GDG Ahmedabad @dhuma1981 Jalandhar Thank you!