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
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
280
Java ジェネリクス入門 2024
nagise
0
710
Amazon Qを使ってIaCを触ろう!
maruto
0
390
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
5
1.3k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
820
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
受け取る人から提供する人になるということ
little_rubyist
0
220
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.2k
初めてDefinitelyTypedにPRを出した話
syumai
0
310
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
5
1.7k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
830
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
110
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
4 Signs Your Business is Dying
shpigford
180
21k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Designing for humans not robots
tammielis
250
25k
The Language of Interfaces
destraynor
154
24k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
What's new in Ruby 2.0
geeforr
343
31k
Navigating Team Friction
lara
183
14k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
For a Future-Friendly Web
brad_frost
175
9.4k
Facilitating Awesome Meetings
lara
50
6.1k
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ʹڵຯ͕͋Γ·ͨ͠Β͓ؾܰʹͲ͏ͧ