PORT Firebase x Flutter

E222076ea6b90ae53c2bc68c8a4e01f1?s=47 shogo.yamada
June 26, 2019
240

PORT Firebase x Flutter

E222076ea6b90ae53c2bc68c8a4e01f1?s=128

shogo.yamada

June 26, 2019
Tweet

Transcript

  1. FlutterͰ࢖͏ Cloud Firestore PORT Firebase × Flutter shoo.yamada

  2. ࣗݾ঺հ Name: shoo.yamada Twitter: @yshogo87 Github: @yshogo ॴଐ:גࣜձࣾZOZOςΫϊϩδʔζ AndroidΤϯδχΞ

  3. ໨࣍ • աڈʹFirebaseͱFlutterΛ࢖ͬͯ࡞ͬͨϓϩμΫτ • Flutter͸FirestoreΛ࢖͑Δͷ͔ • FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ • ։ൃεϐʔυʹ͍ͭͯ •

    ࠓޙͷFirestoreͱFlutterͷಈ͖ʹ͍ͭͯ • ·ͱΊ
  4. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ

  5. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ • Firebase͸RealtimeDatabase͔͠ͳ͔ͬͨ࣌୅ ͔Β৮͍ͬͯͨ • ͦͷࠒ͔ΒFirebaseͷັྗʹࠍΕࠐΈࣗ෼͕ݸ ਓͰ࡞ΔϓϩμΫτ͸શͯFirebaseΛ࢖͍ͬͯΔ • ॳظͷ͜Ζ͸

    @1amageek ͞ΜͷQiitaΛԿճ΋ ಡΜͰ͍ͨ
  6. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ

  7. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ • ͦͷޙFlutterʹग़ձ͏ • ΫϩεϓϥοτϑΥʔϜ΍ɺHotReloadɺඒ͍͠UIΛ ࢖ͬͨ։ൃख๏ΛֶͿ Flutter×Firebaseͬͯ࠷ڧͳΜ ͡ΌͶʁ

  8. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ • νϟοτΞϓϦΛ࡞Δ(ݱࡏ͸αʔϏεऴྃ)

  9. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ

  10. աڈʹFirebaseͱFlutterΛ࢖ͬͨ ϓϩμΫτ • ຊ୳͠ΞϓϦέʔγϣϯ(ݱࡏ͸ϝϯςͯ͠ͳ͍)

  11. ݱࡏ͸SNSαʔϏε ։ൃத

  12. FlutterʹFirebase͸࢖͑Δͷ͔

  13. FlutterʹFirebase͸࢖͑Δͷ͔ →ී௨ʹ࢖͑Δ

  14. FlutterʹFirebase͸࢖͑Δͷ͔

  15. FlutterʹFirebase͸࢖͑Δͷ͔ Firestoreͷincrement΋ରԠ

  16. 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(), }); }
  17. FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ

  18. FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ • ωΠςΟϒͱಉ͡Α͏ʹ࢖͑Δ • Flutter͔ͩΒ࢖͑ͳ͍ɺΈ͍ͨͳ࿩͸جຊత ʹ͸ͳ͠ • ιʔείʔυΛಡΉͱɺωΠςΟϒ(Ob-Cɺ JavaͰॻ͔Εͨίʔυ)ΛಡΜͰ͍Δ͚ͩ

  19. FirestoreͱFlutterͷ૬ੑʹ͍ͭͯ

  20. 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, ); })
  21. ։ൃεϐʔυʹ͍ͭͯ

  22. ։ൃεϐʔυʹ͍ͭͯ • Flutter͕଎͍ (HotReloadɺWidgetΧλϩά etc…..) • FirebaseΛ࢖͑͹ɺαʔόʔαΠυ͸ϝϯς ͳ͠ • Firebase

    × Flutter = ଎͍ ← ౰ͨΓલ
  23. ։ൃεϐʔυʹ͍ͭͯ • ݸਓΞϓϦͷ։ൃظؒ͸͍͍ͩͨ̏ϲ݄ • ̍೔ͷ࡞ۀ࣌ؒ͸̍ʙ̎࣌ؒఔ౓ • ࣮ࡍʹ࢖͍ͬͯͯ΋΍ͬͺ͸΍͍

  24. ։ൃεϐʔυʹ͍ͭͯ • ͍ͬͯͬͯ΋ɺʮFirestoreͷ஌͕ࣝඞཁʯɺ ʮFlutterͷ஌͕ࣝඞཁʯ౳ etc… • ͦΕͧΕʹผͷ஌͕ࣝඞཁ • ͨͩɺFlutter͔ΒFirebase͸ී௨ʹ࢖͑· ͢ɻ

  25. ࠓޙͷಈ͖

  26. ࠓޙͷಈ͖ • Firestoreʹ৽ػೳ͕࣮૷͞ΕΔͱ͙͢Flutter ଆʹissueཱ͕ͬͯରԠ͠͸͡ΊΔ • ࣌ؒࠩ͸͋Δ͕ɺ͜Ε͔Β΋͙͢ʹରԠͯ͠ ͘ΕΔ͸ͣ

  27. ࠓޙͷಈ͖ • Ͱ΋ݱঢ়͸FlutterͱFirestoreΛϑϧʹ࢖ͬͯ ྲྀߦΔαʔϏεͷ࣮੷Λશવݟͳ͍(ࢁాͷ؍ ଌൣғ಺) • ࣮੷Λ࡞Γ΋݉Ͷͯࣗ෼΋ϓϩμΫτ։ൃΛ ͍ͯ͠Δ

  28. ࠓޙͷಈ͖ • ౰໘ɺshogo.yamada͕࡞ΔαʔϏε͸શͯ ʮFlutter×FirebaseʯͰ͍͘ͱࢥ͏ • ஌Γ͍ͨ͜ͱɺΘ͔Βͳ͍͜ͱ͕͋Ε͹͍ͭ Ͱ΋࿈བྷ͍ͩ͘͞ɻ • Twitter: @yshogo87

  29. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ ࠙਌ձͰ͓࿩͠͠·͠ΐ͏ʂ