Slide 1

Slide 1 text

FlutterͱfirebaseΛ ࢖ͬͯϞόΠϧΞϓϦ ʹ௅ઓͯ͠ΈΔ Firebase Japan User Group / meetup / 3 ಹਢཧ໵

Slide 2

Slide 2 text

ࣗݾ঺հ • ಹਢཧ໵
 ීஈ͸Railsͱ͔Ͱ͓࢓ࣄͯ͠·͢ • Twitter : @tomato360
 GitHub: @nasum • Vue.js͕޷͖

Slide 3

Slide 3 text

ࢲͱfirebase

Slide 4

Slide 4 text

ͪΐͬͱલʹগ͠৮ͬͯͨ https://speakerdeck.com/nasum/ electrondefirebasewoshi-tutemita-jia

Slide 5

Slide 5 text

࠷ֶۙͼ௚ͯ͠·͢ श࡞ɿMarkdownEditor https://spellnote.com/

Slide 6

Slide 6 text

৽͍͠ςʔϚΛ໛ࡧத

Slide 7

Slide 7 text

Flutter

Slide 8

Slide 8 text

Flutter • Google੡ • ϞόΠϧΞϓϦ։ൃϑϨʔϜϫʔΫ • ΫϩεϓϥοτϑΥʔϜ • Dartʢʂʁ

Slide 9

Slide 9 text

Flutterͱfirebase͸͍͍૊Έ߹Θͤ
 ʢݸਓͷҙݟ • Flutter • ΫϩεϓϥοτϑΥʔϜ • firebase • αʔόϨε • ࠷খͷ΋ͷΛ࠷଎Ͱ࡞Εͦ͏ͳΠϝʔδ

Slide 10

Slide 10 text

࢖༻ײΛ୳ͬͯΈΔ

Slide 11

Slide 11 text

firebase auth buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.google.gms:google-services:3.2.0' } } android/build.gradle

Slide 12

Slide 12 text

firebase auth apply plugin: 'com.google.gms.google-services' android/app/build.gradle

Slide 13

Slide 13 text

firebase auth import 'package:google_sign_in/google_sign_in.dart'; import 'package:firebase_auth/firebase_auth.dart'; lib/main.dart

Slide 14

Slide 14 text

firebase auth final FirebaseAuth _auth = FirebaseAuth.instance; final GoogleSignIn _googleSignIn = new GoogleSignIn(); lib/main.dart

Slide 15

Slide 15 text

firebase auth void _handleSignIn() async { GoogleSignInAccount googleUser = await _googleSignIn.signIn(); GoogleSignInAuthentication googleAuth = await googleUser.authentication; FirebaseUser siginUser = await _auth.signInWithGoogle( accessToken: googleAuth.accessToken, idToken: googleAuth.idToken, ); setState(() { user = siginUser; }); } lib/main.dart

Slide 16

Slide 16 text

firebase auth if (user != null) { displayName = new Text(user.displayName); email = new Text(user.email); avator = new CircleAvatar(backgroundImage: new NetworkImage(user.photoUrl)); } lib/main.dart

Slide 17

Slide 17 text

firebase auth

Slide 18

Slide 18 text

ग़དྷͨը໘

Slide 19

Slide 19 text

ͪΌΜͱAnalytics΋ಈ͘

Slide 20

Slide 20 text

firebase auth • ඞཁͳϥΠϒϥϦ • google_sign_in
 https://pub.dartlang.org/packages/google_sign_in • firebase_auth
 https://pub.dartlang.org/packages/firebase_auth • ίʔυྫ • https://github.com/nasum/flutter_firebase_playground/ commit/66acc51fc6d67258dfb4b0194b3dcac72ff8992a

Slide 21

Slide 21 text

firebase auth ࢖༻ײ • FirebaseUserͷΠϯελϯεΛ࡞Ε͹OK • JS൛ͱ࢖༻ײ͸ࣅ͍ͯΔ

Slide 22

Slide 22 text

DartͷϥΠϒϥϦͷϖʔδ

Slide 23

Slide 23 text

cloud firestore import ‘package:cloud_firestore/cloud_firestore.dart'; QuerySnapshot snapShot = await Firestore.instance.collection(‘memo').getDocuments(); Firestore.instance .collection('memo') .document() .setData({'text': _inputText}); lib/main.dart

Slide 24

Slide 24 text

cloud firestore

Slide 25

Slide 25 text

cloud firestore void _getDocument(List list) async { QuerySnapshot snapShot = await Firestore.instance.collection('memo').getDocuments(); setState(() { snapShot.documents.forEach((DocumentSnapshot ds) { SizedBox box = new SizedBox( width: 300.0, height: 50.0, child: new Card(child: new Text(ds.data['text'])), ); list.add(box); }); }); } lib/main.dart

Slide 26

Slide 26 text

ग़དྷͨը໘

Slide 27

Slide 27 text

cloud firestore

Slide 28

Slide 28 text

cloud firestore

Slide 29

Slide 29 text

cloud firestore • ඞཁͳϥΠϒϥϦ • cloud_firestore
 https://pub.dartlang.org/packages/cloud_firestore • ίʔυྫ
 https://github.com/nasum/ flutter_firebase_playground/commit/ 16960fb4ceafe0f1ed5bc85eb388a722e4739079

Slide 30

Slide 30 text

cloud firestoreײ૝ • ࢖༻ײ͸JSͷͱࣅ͍ͯΔ • ࠷৽ͷ0.3.2Λ࢖͏ͱίϯύΠϧग़དྷͳ͍
 ʢཁௐࠪ • Ή͠ΖFlutterͷঢ়ଶ؅ཧͰۤ࿑ͨ͠

Slide 31

Slide 31 text

·ͱΊ • JSಉ༷ʹDart൛΋ָʹ࢖͑Δ • FlutterͱDartʹ׳Εͳͯۤ͘࿑ͨ͠ʢ׳Εͷ໰୊ • ΫϩεϓϥοτϑΥʔϜͱαʔόϨε͸࠷ڧͳؾ ͕͍ͯ͠Δ • ΞϓϦΛͭ͘Γ͍ͨਓʹ͓קΊ͍ͨ͠૊Έ߹Θͤ

Slide 32

Slide 32 text

αϯϓϧίʔυ • https://github.com/nasum/flutter_firebase_playground