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
380
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
680
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
1.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.8k
ZOZOTech meetup Frontend #10
yshogo
2
1.7k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
500
Firebase ML Kitを使った デモアプリ活用事例 @Google App DOJO
yshogo
1
170
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
44
13k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Being A Developer After 40
akosma
87
590k
Building Your Own Lightsaber
phodgson
103
6.1k
GitHub's CSS Performance
jonrohan
1030
460k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
Facilitating Awesome Meetings
lara
50
6.1k
Building an army of robots
kneath
302
44k
How GitHub (no longer) Works
holman
311
140k
Making the Leap to Tech Lead
cromwellryan
133
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
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ ࠙ձͰ͓͠͠·͠ΐ͏ʂ