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
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
Amazon Qを使ってIaCを触ろう!
maruto
0
400
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
ヤプリ新卒SREの オンボーディング
masaki12
0
130
最新TCAキャッチアップ
0si43
0
140
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
初めてDefinitelyTypedにPRを出した話
syumai
0
400
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
A designer walks into a library…
pauljervisheath
203
24k
GraphQLとの向き合い方2022年版
quramy
43
13k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
How GitHub (no longer) Works
holman
310
140k
How to Ace a Technical Interview
jacobian
276
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Become a Pro
speakerdeck
PRO
25
5k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
A Philosophy of Restraint
colly
203
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
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ʹڵຯ͕͋Γ·ͨ͠Β͓ؾܰʹͲ͏ͧ