Upgrade to Pro — share decks privately, control downloads, hide ads and more …

中規模プロダクトにFlutterを採用する

 中規模プロダクトにFlutterを採用する

Naoto Horiguchi

July 16, 2019
Tweet

Other Decks in Programming

Transcript

  1. தن໛ϓϩμΫτ͕৐Γӽ͑Δ΂͖՝ ୊ • ଞSDKͱͷ࿈ܞ • LINE SDK • ಺੡αʔϏεͱͷ࿈ܞ •

    ͓஌Βͤ഑৴αʔϏε • ଟݴޠԽ • ࣾ಺ͷ຋༁γεςϜͱͷ࿈ܞ
  2. 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
  3. 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); } }
  4. .strings to ARB ARB { "@@locale": "ja", "@@last_modified": "2019-07-09T14:53:30.474639", "helloText":

    "͜Μʹͪ͸ʂ{lastName} {firstName}", "@helloText": { "type": "text", "placeholders": { "lastName": {}, "firstName": {} } } }
  5. intl 1.ॻ͘ String helloText(String lastName, String firstName) => Intl.message( '͜Μʹͪ͸ʂ${lastName}

    ${firstName}', name: 'helloText', args: [lastName, firstName], ); 2.ARBΛੜ੒ 3.ARBΛ຋༁ʹ·Θ͢ 4.ARB͔ΒଟݴޠԽ༻ͷίʔυΛੜ੒
  6. ࣗಈੜ੒͞ΕΔίʔυ Message.dart import 'package:intl/intl.dart'; class Messages { String helloText(String lastName,

    String firstName) => Intl.message( '͜Μʹͪ͸ʂ${lastName} ${firstName}', name: 'helloText', args: [lastName, firstName], ); }
  7. MixinͰศར ... import 'messages.dart'; class L10n with Messages { static

    L10n of(BuildContext context) { return Localizations.of<L10n>(context, L10n); } ...
  8. એ఻ ! • LINE SDK ͸ͪ͜Β • https:/ /pub.dev/packages/flutter_line_sdk •

    https:/ /developers.line.biz/ja/docs/flutter-sdk/ • ϦϑΝϥϧ࠾༻ΛڧԽ͍ͯ͠·͢ • ΋͠LINEʹڵຯ͕͋Γ·ͨ͠Β͓ؾܰʹͲ͏ͧ