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
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
170
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
たのしいparse.y
ydah
3
120
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.2k
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
660
Discord Bot with AI -for English learners-
xin9le
1
120
Go の GC の不得意な部分を克服したい
taiyow
2
720
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
170
[FlutterKaigi2024] Effective Form 〜Flutterによる複雑なフォーム開発の実践〜
chocoyama
1
4k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.4k
Refactor your code - refactor yourself
xosofox
1
230
Featured
See All Featured
Bash Introduction
62gerente
608
210k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How GitHub (no longer) Works
holman
311
140k
Documentation Writing (for coders)
carmenintech
66
4.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
A better future with KSS
kneath
238
17k
Scaling GitHub
holman
458
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
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ʹڵຯ͕͋Γ·ͨ͠Β͓ؾܰʹͲ͏ͧ