Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PORT Firebase x Flutter
Search
shogo.yamada
June 26, 2019
0
350
PORT Firebase x Flutter
shogo.yamada
June 26, 2019
Tweet
Share
More Decks by shogo.yamada
See All by shogo.yamada
Jetpack ComposeへのリファクタリングのTIPS: CustomViewの便利な使い方 / Refactoring TIPS to Jetpack Compose: Useful usage of CustomView
yshogo
0
580
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
980
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.2k
PORT_Firebase___Algolia.pdf
yshogo
0
220
Flutter_meetup_tokyo__10.pdf
yshogo
0
5.7k
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
490
Firebase ML Kitを使った デモアプリ活用事例 @Google App DOJO
yshogo
1
170
Featured
See All Featured
A Philosophy of Restraint
colly
202
16k
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Statistics for Hackers
jakevdp
796
220k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Designing with Data
zakiwarfel
98
5.1k
Speed Design
sergeychernyshev
22
480
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
31
2.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.9k
Transcript
FlutterͰ͏ Cloud Firestore PORT Firebase × Flutter shoo.yamada
ࣗݾհ Name: shoo.yamada Twitter: @yshogo87 Github: @yshogo ॴଐ:גࣜձࣾZOZOςΫϊϩδʔζ AndroidΤϯδχΞ
࣍ • աڈʹFirebaseͱFlutterΛͬͯ࡞ͬͨϓϩμΫτ • FlutterFirestoreΛ͑Δͷ͔ • FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ • ։ൃεϐʔυʹ͍ͭͯ •
ࠓޙͷFirestoreͱFlutterͷಈ͖ʹ͍ͭͯ • ·ͱΊ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ • FirebaseRealtimeDatabase͔͠ͳ͔ͬͨ࣌ ͔Β৮͍ͬͯͨ • ͦͷࠒ͔ΒFirebaseͷັྗʹࠍΕࠐΈ͕ࣗݸ ਓͰ࡞ΔϓϩμΫτશͯFirebaseΛ͍ͬͯΔ • ॳظͷ͜Ζ
@1amageek ͞ΜͷQiitaΛԿճ ಡΜͰ͍ͨ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ • ͦͷޙFlutterʹग़ձ͏ • ΫϩεϓϥοτϑΥʔϜɺHotReloadɺඒ͍͠UIΛ ͬͨ։ൃख๏ΛֶͿ Flutter×Firebaseͬͯ࠷ڧͳΜ ͡ΌͶʁ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ • νϟοτΞϓϦΛ࡞Δ(ݱࡏαʔϏεऴྃ)
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ
աڈʹFirebaseͱFlutterΛͬͨ ϓϩμΫτ • ຊ୳͠ΞϓϦέʔγϣϯ(ݱࡏϝϯςͯ͠ͳ͍)
ݱࡏSNSαʔϏε ։ൃத
FlutterʹFirebase͑Δͷ͔
FlutterʹFirebase͑Δͷ͔ →ී௨ʹ͑Δ
FlutterʹFirebase͑Δͷ͔
FlutterʹFirebase͑Δͷ͔ FirestoreͷincrementରԠ
FlutterʹFirebase͑Δͷ͔ ͍৺΄΅Web൛Firebase Future<void> postMessage(String groupId, String uid, String message, int
type) async { return await Firestore.instance .collection("group") .document(groupId) .collection("message") .add({ "uid": uid, "message": message, "type": type, "created_at": FieldValue.serverTimestamp(), }); }
FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ
FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ • ωΠςΟϒͱಉ͡Α͏ʹ͑Δ • Flutter͔ͩΒ͑ͳ͍ɺΈ͍ͨͳجຊత ʹͳ͠ • ιʔείʔυΛಡΉͱɺωΠςΟϒ(Ob-Cɺ JavaͰॻ͔Εͨίʔυ)ΛಡΜͰ͍Δ͚ͩ
FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ
FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ child: StreamBuilder( stream: chatHelper .getMessages(widget.groupId) .asBroadcastStream(), builder: (context, snapshot)
{ if (snapshot == null || snapshot.data == null) return Container(); return new ListView.builder( padding: new EdgeInsets.all(8.0), reverse: true, itemBuilder: (_, int index) { // ͜͜ͰϝοηʔδΛදࣔ͢Δ }, itemCount: snapshot.data.documents.length, ); })
։ൃεϐʔυʹ͍ͭͯ
։ൃεϐʔυʹ͍ͭͯ • Flutter͕͍ (HotReloadɺWidgetΧλϩά etc…..) • FirebaseΛ͑ɺαʔόʔαΠυϝϯς ͳ͠ • Firebase
× Flutter = ͍ ← ͨΓલ
։ൃεϐʔυʹ͍ͭͯ • ݸਓΞϓϦͷ։ൃظ͍͍ؒͩͨ̏ϲ݄ • ̍ͷ࡞ۀ࣌ؒ̍ʙ̎࣌ؒఔ • ࣮ࡍʹ͍ͬͯͯͬͺ͍
։ൃεϐʔυʹ͍ͭͯ • ͍ͬͯͬͯɺʮFirestoreͷ͕ࣝඞཁʯɺ ʮFlutterͷ͕ࣝඞཁʯ etc… • ͦΕͧΕʹผͷ͕ࣝඞཁ • ͨͩɺFlutter͔ΒFirebaseී௨ʹ͑· ͢ɻ
ࠓޙͷಈ͖
ࠓޙͷಈ͖ • Firestoreʹ৽ػೳ͕࣮͞ΕΔͱ͙͢Flutter ଆʹissueཱ͕ͬͯରԠ͠͡ΊΔ • ࣌ؒࠩ͋Δ͕ɺ͜Ε͔Β͙͢ʹରԠͯ͠ ͘ΕΔͣ
ࠓޙͷಈ͖ • Ͱݱঢ়FlutterͱFirestoreΛϑϧʹͬͯ ྲྀߦΔαʔϏεͷ࣮Λશવݟͳ͍(ࢁాͷ؍ ଌൣғ) • ࣮Λ࡞Γ݉ͶͯࣗϓϩμΫτ։ൃΛ ͍ͯ͠Δ
ࠓޙͷಈ͖ • ໘ɺshogo.yamada͕࡞ΔαʔϏεશͯ ʮFlutter×FirebaseʯͰ͍͘ͱࢥ͏ • Γ͍ͨ͜ͱɺΘ͔Βͳ͍͜ͱ͕͋Ε͍ͭ Ͱ࿈བྷ͍ͩ͘͞ɻ • Twitter: @yshogo87
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ ࠙ձͰ͓͠͠·͠ΐ͏ʂ