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
Flutterとfirebaseを使ってモバイルアプリに挑戦してみる
Search
Masaya Nasu
April 02, 2018
Technology
3
2.8k
Flutterとfirebaseを使ってモバイルアプリに挑戦してみる
Flutterとfirebaseを使ってモバイルアプリを作ろうとしている話。
サンプルコード
https://github.com/nasum/flutter_firebase_playground
Masaya Nasu
April 02, 2018
Tweet
Share
More Decks by Masaya Nasu
See All by Masaya Nasu
What's new in Go 1.23
nasum
0
68
カミナシのフロントエンド開発の効率化の取り組み
nasum
2
260
新参者だけどバーンアウトしかけているチームを立て直す
nasum
21
11k
DjangoではじめるGraphQLとフロントエンド開発の協業
nasum
1
3.2k
grpc-gatewayで作るマイクロサービスの管理画面
nasum
1
7.4k
コストをかけずに機械学習の環境を整える&学習環境(人間の)
nasum
0
1.5k
Elixirの好きなところ
nasum
0
470
ElectronでFirebaseを使ってみた(仮)
nasum
2
3.3k
Vue.jsを導入する際失敗したこと
nasum
1
4.1k
Other Decks in Technology
See All in Technology
TypeScript、上達の瞬間
sadnessojisan
46
13k
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
520
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
Storybook との上手な向き合い方を考える
re_taro
1
180
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
OS 標準のデザインシステムを超えて - より柔軟な Flutter テーマ管理 | FlutterKaigi 2024
ronnnnn
1
280
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
The Pragmatic Product Professional
lauravandoore
31
6.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
A Philosophy of Restraint
colly
203
16k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Docker and Python
trallard
40
3.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
Transcript
FlutterͱfirebaseΛ ͬͯϞόΠϧΞϓϦ ʹઓͯ͠ΈΔ Firebase Japan User Group / meetup /
3 ಹਢཧ
ࣗݾհ • ಹਢཧ ීஈRailsͱ͔Ͱ͓ࣄͯ͠·͢ • Twitter : @tomato360 GitHub: @nasum
• Vue.js͕͖
ࢲͱfirebase
ͪΐͬͱલʹগ͠৮ͬͯͨ https://speakerdeck.com/nasum/ electrondefirebasewoshi-tutemita-jia
࠷ֶۙͼͯ͠·͢ श࡞ɿMarkdownEditor https://spellnote.com/
৽͍͠ςʔϚΛࡧத
Flutter
Flutter • Google • ϞόΠϧΞϓϦ։ൃϑϨʔϜϫʔΫ • ΫϩεϓϥοτϑΥʔϜ • Dartʢʂʁ
Flutterͱfirebase͍͍Έ߹Θͤ ʢݸਓͷҙݟ • Flutter • ΫϩεϓϥοτϑΥʔϜ • firebase • αʔόϨε
• ࠷খͷͷΛ࠷Ͱ࡞Εͦ͏ͳΠϝʔδ
༻ײΛ୳ͬͯΈΔ
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
firebase auth apply plugin: 'com.google.gms.google-services' android/app/build.gradle
firebase auth import 'package:google_sign_in/google_sign_in.dart'; import 'package:firebase_auth/firebase_auth.dart'; lib/main.dart
firebase auth final FirebaseAuth _auth = FirebaseAuth.instance; final GoogleSignIn _googleSignIn
= new GoogleSignIn(); lib/main.dart
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
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
firebase auth
ग़དྷͨը໘
ͪΌΜͱAnalyticsಈ͘
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
firebase auth ༻ײ • FirebaseUserͷΠϯελϯεΛ࡞ΕOK • JS൛ͱ༻ײࣅ͍ͯΔ
DartͷϥΠϒϥϦͷϖʔδ
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
cloud firestore
cloud firestore void _getDocument(List<Widget> 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
ग़དྷͨը໘
cloud firestore
cloud firestore
cloud firestore • ඞཁͳϥΠϒϥϦ • cloud_firestore https://pub.dartlang.org/packages/cloud_firestore • ίʔυྫ https://github.com/nasum/
flutter_firebase_playground/commit/ 16960fb4ceafe0f1ed5bc85eb388a722e4739079
cloud firestoreײ • ༻ײJSͷͱࣅ͍ͯΔ • ࠷৽ͷ0.3.2Λ͏ͱίϯύΠϧग़དྷͳ͍ ʢཁௐࠪ • Ή͠ΖFlutterͷঢ়ଶཧͰۤ࿑ͨ͠
·ͱΊ • JSಉ༷ʹDart൛ָʹ͑Δ • FlutterͱDartʹ׳Εͳͯۤ͘࿑ͨ͠ʢ׳Εͷ • ΫϩεϓϥοτϑΥʔϜͱαʔόϨε࠷ڧͳؾ ͕͍ͯ͠Δ • ΞϓϦΛͭ͘Γ͍ͨਓʹ͓קΊ͍ͨ͠Έ߹Θͤ
αϯϓϧίʔυ • https://github.com/nasum/flutter_firebase_playground