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
370
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
640
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
1k
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.3k
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
500
Firebase ML Kitを使った デモアプリ活用事例 @Google App DOJO
yshogo
1
170
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Why Our Code Smells
bkeepers
PRO
334
57k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Happy Clients
brianwarren
98
6.7k
Writing Fast Ruby
sferik
627
61k
Navigating Team Friction
lara
183
14k
Rails Girls Zürich Keynote
gr2m
94
13k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Scaling GitHub
holman
458
140k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
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
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ ࠙ձͰ͓͠͠·͠ΐ͏ʂ