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を採用する
Search
Naoto Horiguchi
July 16, 2019
Programming
12
5.2k
中規模プロダクトにFlutterを採用する
Flutter meetup Tokyo #10
https://flutter-jp.connpass.com/event/134921/
Naoto Horiguchi
July 16, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.3k
Go の GC の不得意な部分を克服したい
taiyow
3
1k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
610
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
テストコード書いてみませんか?
onopon
2
310
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
120
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
910
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
840
為你自己學 Python
eddie
0
510
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
2
1.6k
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
5.9k
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
420
Featured
See All Featured
The Language of Interfaces
destraynor
155
24k
Six Lessons from altMBA
skipperchong
27
3.5k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Optimizing for Happiness
mojombo
376
70k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Docker and Python
trallard
43
3.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Rails Girls Zürich Keynote
gr2m
94
13k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
Code Review Best Practice
trishagee
65
17k
Transcript
Flutter Meetup Tokyo #10 தنϓϩμΫτͰFlutterΛ࠾༻͢ Δ LINEגࣜձࣾ ງޱਓ@naonya3
ࣗݾհ ງޱਓ@naonya3 • iOS։ൃ7΄Ͳ • Flutter 3ϲ݄΄Ͳ • LINEͰಇ͍͍ͯ·͢
ຊ͍͑ͨ͜ͱ • FlutterϓϩμΫτʹ࠾༻Ͱ͖Δ
͢༰ • ͳͥ࠾༻͢Δؾʹͳͬͨͷ͔ • தنϓϩμΫτ͕Γӽ͑Δ͖՝ • Tips
ͳͥ࠾༻͢Δؾʹͳͬͨͷ͔ • ॳظʹΞαΠϯͰ͖ΔΞϓϦΤϯδχΞ͕֤OS̍ਓ͍ͮͭͨ • ։ൃظؒ͋·Γ༨༟͕ͳ͍ • ༷Fix·Ͱʹ͕࣌ؒ͋Γٕज़ݕূͷ͕࣌ؒͱΕͨ • PlatformView͕Α͘ಈ͍ͨ
PlatformViewͱ • NativeͰ࣮ͨ͠ViewΛFlutterͷWidgetͱͯ͠ඳը͢Δػೳ • Flutter͚ͩͰ࣮ݱ͕͍͠ػೳΛ࣮͢ΔͨΊ
FlutterͰNativeͷػೳΛ͍͍ͨ ߹ • PlatformView • Nativeͷը໘ΛFlutterͷWidgetͱͯ͠ը໘ʹඳըͰ͖Δػೳ • MethodChannel • Flutter-NativeؒͰػೳͷݺͼग़͠ͱσʔλͷΓऔΓ͕Ͱ͖Δ
• EventChannel • ҰํతʹσʔλΛ͚͛ͭͮͦΕΛߪಡ͢ΔɻStream
தنϓϩμΫτ͕Γӽ͑Δ͖՝ • ଞSDKͱͷ࿈ܞ • LINE SDK • αʔϏεͱͷ࿈ܞ •
͓Βͤ৴αʔϏε • ଟݴޠԽ • ࣾͷ༁γεςϜͱͷ࿈ܞ
LINE SDK • LINEͷAPIΛୟͨ͘Ίʹ༻ҙ͞Ε͍ͯΔSDK • ओʹLINEϩάΠϯ
LINE SDK • LINE SDK for iOS • LINE SDK
for Android • LINE SDK for Unity • LINE SDK for Flutter • https:/ /pub.dev/packages/flutter_line_sdk
pubspec.yaml dependencies flutter_line_sdk: ^1.0.1
main.dart import 'package:flutter_line_sdk/flutter_line_sdk.dart'; // Setup void main() { LineSDK.instance.setup("{CHANNEL ID}").then((_)
{ print("LineSDK Prepared"); // login(); }); runApp(App()); } // Login void login() async { try { final result = await LineSDK.instance.login(); print(result.userProfile.displayName); } on PlatformException catch (e) { // Error handling. print(e); } }
ଞSDKΛFlutter͔Βར༻͢Δํ๏ • MethodChannelͰϥοϓ͢Δ • Flutter <- MethodChannel -> SDK
͓Βͤ৴αʔϏεͱͷ࿈ܞ • ཧը໘͔Β͓ΒͤΛొ • ΞϓϦىಈ࣌ʹpopupΛදࣔͰ͖Δ • FlutterSDKఏڙ͞Ε͍ͯͳ͍ • ࣗͨͪͰDartͰ࣮ͨ͠ •
ࣾͷެ։υΩϡϝϯτඋͳͲͰFlutterΛ͔ࣾΒ Γ্͍͖͍͛ͯͨ !
ଟݴޠԽ • ଟݴޠԽࣗମʹintlΛར༻͍ͯ͠Δ • ࣾͷ༁ϑϩʔʹ߹ΘͤΔඞཁ͕͋ͬͨ
ଟݴޠԽͷϑϩʔ • keyΛఆٛͯࣾ͠ͷ༁γεςϜʹొ • ༁ऀ༁Λ༁γεςϜʹొ • ։ൃऀ༁͞ΕͨϑΝΠϧΛγεςϜ͔Βμϯϩʔυ • ରԠܗࣜ strings.xml
/ .stringsɹͳͲ • intlARBʹରԠ͍ͯ͠Δ
.strings to ARB .string hello.text=͜Μʹͪʂ{lastName} {firstName}
.strings to ARB ARB { "@@locale": "ja", "@@last_modified": "2019-07-09T14:53:30.474639", "helloText":
"͜Μʹͪʂ{lastName} {firstName}", "@helloText": { "type": "text", "placeholders": { "lastName": {}, "firstName": {} } } }
Tips • gRPC • intl
gRPC • packageʹ·ͱΊΔ • submoduleΛߋ৽ͯ͠push • drone͕hookͯ͠build pubspec.yaml my_grpc_package: git:
url:
[email protected]
:my_grpc_package.git
intl 1.ॻ͘ String helloText(String lastName, String firstName) => Intl.message( '͜Μʹͪʂ${lastName}
${firstName}', name: 'helloText', args: [lastName, firstName], ); 2.ARBΛੜ 3.ARBΛ༁ʹ·Θ͢ 4.ARB͔ΒଟݴޠԽ༻ͷίʔυΛੜ
ਤղฐࣾͷଟݴޠԽϑϩʔ
ࣗಈੜ͞ΕΔίʔυ Message.dart import 'package:intl/intl.dart'; class Messages { String helloText(String lastName,
String firstName) => Intl.message( '͜Μʹͪʂ${lastName} ${firstName}', name: 'helloText', args: [lastName, firstName], ); }
MixinͰศར ... import 'messages.dart'; class L10n with Messages { static
L10n of(BuildContext context) { return Localizations.of<L10n>(context, L10n); } ...
·ͱΊ ࢲͨͪϓϩμΫτʹೖ͍͖ͯ͠·͢
એ ! • LINE SDK ͪ͜Β • https:/ /pub.dev/packages/flutter_line_sdk •
https:/ /developers.line.biz/ja/docs/flutter-sdk/ • ϦϑΝϥϧ࠾༻ΛڧԽ͍ͯ͠·͢ • ͠LINEʹڵຯ͕͋Γ·ͨ͠Β͓ؾܰʹͲ͏ͧ