FlutterとKotlin/Nativeで作る クロスプラットフォームは実現出来るのか? 〜プロローグ編〜

2ddbd112dbc8c6572fe79821584c1465?s=47 Kurun
January 25, 2020

FlutterとKotlin/Nativeで作る クロスプラットフォームは実現出来るのか? 〜プロローグ編〜

2ddbd112dbc8c6572fe79821584c1465?s=128

Kurun

January 25, 2020
Tweet

Transcript

  1. 2.

    About me @kurun_pan @Kurun-pan Software Engineer @Sony Linux / Android

    /εϓϥτΡʔϯΛѪ͢ΔΤϯδχΞ Kurun / ͘ΔΜ
  2. 4.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ຊ೔ͷ಺༰
  3. 5.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  4. 6.

    FlutterΞϓϦέʔγϣϯ 6* 'MVUUFS "OESPJEݻ༗ +BWB,PUMJO J04ݻ༗ 4XJGU0CKFDUJWF$ NBD04ݻ༗ 4XJGU0CKFDUJWF$FUD -JOVYݻ༗

    $$ 8JOEPXTݻ༗ 8JO$ 8FCݻ༗ )5.- +BWB4DSJQU 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT • UI͸શϓϥοτϑΥʔϜͰڞ௨ • ϓϥοτϑΥʔϜґଘ෦෼ʢϋʔυ΢ΣΞؔ࿈, OSؔ࿈, ॏ͍ॲཧʣ͸ݸผ࣮૷ • ͦ΋ͦ΋Flutter͸UIಛԽͷϑϨʔϜϫʔΫ ڞ௨ϩδοΫ %BSU ·ͩЋЌ൛
  5. 7.

    Flutter + Kotlin/NativeͷΫϩεϓϥοτϑΥʔϜ 6* 'MVUUFS "OESPJEݻ༗ +BWB,PUMJO ڞ௨ϩδοΫ ,PUMJO/BUJWF J04ݻ༗

    4XJGU0CKFDUJWF$ NBD04ݻ༗ 4XJGU0CKFDUJWF$FUD -JOVYݻ༗ $$ 8JOEPXTݻ༗ 8JO$ 8FCݻ༗ )5.- *OUFSPQ LPUMJOD 1MBUGPSN$IBOOFMT *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODKT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT • UI͸શϓϥοτϑΥʔϜͰڞ௨ • UIͱϩδοΫΛ៉ྷʹ෼཭͠(MVVM/Bloc Patten)ɺUI (View) Ҏ֎ΛKotlin/NativeͰڞ௨Խ ‣ ֤ϓϥοτϑΥʔϜͰಠࣗʹ࡞੒͢Δͷ͸ϒϦοδ (Interop) ෦෼ͷΈ Ͳ͜·ͰϩδοΫΛڞ௨Խग़དྷΔʁ
  6. 9.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  7. 10.

    • ಛ௃ ‣ Google੡OSSͷܰྔͳUIϑϨʔϜϫʔΫ ‣ ΫϩεϓϥοτϑΥʔϜ ‣ Τϯδϯ෦෼͸C++هड़ ‣ ։ൃݴޠ͸DartͰએݴܕϓϩάϥϛϯά

    ‣ ϓϥοτϑΥʔϜґଘ෦෼͸֤ࣗϓϥάΠϯͱ͍͏ܗͰ࣮૷ ✓ ެࣜϓϥάΠϯҎ֎ʹ΋ɺଟ͘ͷϓϥάΠϯ͕ଘࡏʢϥΠϒϥϦʣ ‣ ը໘΍Ξχϝʔγϣϯ͕؆୯ʹ࡞੒Մೳ ‣ ެࣜαΠτͷυΩϡϝϯτ͕ॆ࣮͍ͯ͠Δ ‣ ͜͜1ʙ2೥Ͱٸ଎ʹਓؾ͕ग़͖ͯͨͱ͍͏ҹ৅ ɹɹ὎ UnityͷUI൛ͱࢥ͑͹෼͔Γқ͍͔΋ • ϓϥοτϑΥʔϜαϙʔτঢ়گ ‣ iOS/Android ✓ ਖ਼ࣜαϙʔτࡁΈ (2018/12ʙ) ‣ Web ✓ ϕʔλ൛ (2019/12ʙ) ‣ macOS ✓ ΞϧϑΝ൛ (2019/12ʙ) ‣ Linux/Windows ✓ Կͱͳ͘࢖͑ΔϨϕϧͷ͓ࢼ͠൛ (2018/12ʙ) • ݱࡏͷ҆ఆ൛όʔδϣϯ ‣ Flutter 1.12.13 ‣ Dart 2.7 Flutter֓ཁ
  8. 11.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  9. 12.

    • ެࣜϦϑΝϨϯε ‣ https://kotlinlang.org/docs/reference/native-overview.html • ಛ௃ ‣ ݱ࣌఺Ͱ·ͩϕʔλ൛ ✓ https://github.com/JetBrains/kotlin-native/blob/master/RELEASE_NOTES.md

    ‣ KotlinιʔείʔυΛωΠςΟϒόΠφϦ (kexe) ʹίϯύΠϧ ‣ ίϯύΠϥʹLLVMΛར༻ ‣ Ϗϧυ͕ͱʹ͔͘஗͍… ‣ ଟ͘ͷϓϥοτϑΥʔϜ (Android, iOS, macOS, Linux, Windows, watchOS etc) Λαϙ ʔτ ‣ so/dylib/dll, a, framework, klibͳͲͷೖग़ྗ΋αϙʔτ ‣ Interop (interoperability) ػೳΛαϙʔτ ‣ PlatformґଘͷػೳΛLibraryΛఏڙ • Interopػೳ ‣ ϔομʔϑΝΠϧΛࣗಈੜ੒ ‣ cinteropίϚϯυͰCݴޠͷϔομʔϑΝΠϧ͔ΒKotlinϥΠϒϥϦΛࣗಈੜ੒ • Platform Library (klib) ‣ POSIX API, OSඪ४ͷAPIͳͲΛklibͱͯ͠ఏڙ ‣ iOS/macOSͷ৔߹ɺAVKit΍ͦͷଞͷػೳͷϥΠϒϥϦ΋αϙʔτ͞Εɺॆ࣮ ‣ Windows / Linux͸POSIX APIఔ౓ͰmacOSʹେ͖͘໨ྼΓ (͋͘·Ͱ΋ݱ࣌఺ͷ࿩) Kotlin/Native֓ཁ
  10. 13.

    • ωοτ্ʹ͸೔ຊޠͷ৘ใ͕গͳ͍Ͱ͕͢ɺҎԼ͕ษڧʹͳΓ·͢ ‣ Kotlin / Native͸ͳͥಈ͘ͷ͔ʁ ✓ Kotlin Fest 2019

    ηογϣϯϨϙʔτ ✓ https://developers.cyberagent.co.jp/blog/archives/23149/ Kotlin/Nativeͷ࢓૊Έʹ͍ͭͯͷࢀߟࢿྉ
  11. 15.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  12. 16.

    • ࠓճ͸ϏϧυπʔϧͷGradleະ࢖༻ ‣ ཧ༝ ✓ Kotlin/NativeίϯύϥΠΛૉͷঢ়ଶͰ৮ֶͬͯ΂Δ - Ϗϧυπʔϧ͸ศར͕ͩɺίϯύΠϥͷ࢓૊ΈΛ஌Δʹ͸গ͠अຐ ✓ FlutterͷAndroidҎ֎ͷPlatformͰѻ͍ਏ͍Մೳੑ͕͋Δ

    • ͨͩ͠ɺ௨ৗ͸IDE (IntelliJ IDEA) ͸࢖ͬͨํ͕ྑ͍Ͱ͢ ‣ kotlinx-coroutines-core-nativeͱ͔ͷύοέʔδΛ௥Ճͯ͠ར༻͢ Δ৔߹ʹɺͲ͔͜Βμ΢ϯϩʔυ͢Ε͹͍͍ͷ్͔ํʹ฻Ε·͢… [Kotlin/Native] ࠓճ͸Gradle͸ະ࢖༻
  13. 17.

    [Kotlin/Native] ίϯύΠϥͷΠϯετʔϧखॱ for macOS # macOS൛Λμ΢ϯϩʔυ $ wget https://github.com/JetBrains/kotlin/releases/download/v1.3.61/kotlin-native-macos-1.3.61.tar.gz #

    ղౚˍద੾ͳ৔ॴʹΠϯετʔϧ(ྫ) $ tar xzvf kotlin-native-macos-1.3.61.tar.gz $ sudo mkdir -p /usr/local/kotlin-native $ sudo mv kotlin-native-macos-1.3.61/* /usr/local/kotlin-native # ύεΛ௨͢(ྫ) $ export PATH=$PATH:/usr/local/kotlin-native/bin • Πϯετʔϧ͸μ΢ϯϩʔυˍղౚͷΈ • ϓϥοτϑΥʔϜຖʹϏϧυ͞Εͨ࠷৽൛͕͋Γ·͢ ‣ https://github.com/JetBrains/kotlin/releases/latest
  14. 18.

    [Kotlin/Native] ίϯύΠϥͷجຊతͳ࢖͍ํ # Ϗϧυ $ kotlinc-native hello.kt -o hello #

    ࣮ߦ $ ./hello.kexe Hello, World! # μΠφϛοΫϥΠϒϥϦ࡞੒͸ҎԼ # macOSͷ৔߹ɺlibhello.dylib, hello_api.h͕ੜ੒ $ kotlinc-native hello.kt -p dynamic GVONBJO BSHT"SSBZ4USJOH \ QSJOUMO )FMMP 8PSME  ^ • kotlinc-nativeίϚϯυ ‣ ܶతʹ஗͍Ͱ͢… • ग़ྗܗࣜ ‣ ࣮ߦܗࣜ (kexe) ‣ C/C++, Swift/Objective-C޲͚ͷϥΠϒϥϦ ‣ ͓ΑͼϔομϑΝΠϧ౳ • ίϚϯυΦϓγϣϯ͕গͳ͍ ‣ ϔϧϓΛݟΕ͹งғؾͰ࢖͍ํ͕෼͔Δ͸ͣͰ͢ ‣ kotlinc-native -h ιʔείʔυ ίϯύΠϥ࢖༻ྫ
  15. 19.

    [Kotlin/Native] cinteropίϚϯυ # OSLogϥΠϒϥϦΛklibԽ $ cinterop -def /usr/local/kotlin-native/platformLibs/ src/platform/osx/OSLog.def -o

    osloglib # klibΛϦϯΫ࣮ͯ͠ߦόΠφϦΛੜ੒ $ kotlinc-native -library osloglib sample.kt -o sample • defϑΝΠϧ͸ɺklibϑΝΠϧੜ੒ʹར༻ • defϑΝΠϧͱ͸ʁ • ϔομϑΝΠϧ΍ϥΠϒϥϦͷύεͳͲهࡌͨ͠ϑΝΠ ϧ • Platform Libraryͱͯ͠ඪ४తͳ΋ͷ͸ίϯύΠϥʹ෇ଐ • klib (Kotlin Libraries) ϑΝΠϧͱ͸ʁ • KotlinͷϒϦοδελϒ΍ωΠςΟϒϥΠϒϥϦͳͲΛ ·ͱΊͨϥΠϒϥϦܗࣜͷϑΝΠϧ • klibίϚϯυͰத਎ͷ֬ೝ΍Πϯετʔϧ౳͕Մೳ • ͦͷଞ • macOSͷϥΠϒϥϦ͸݁ߏॆ࣮͍ͯ͠Δ • Linux͸·ͩ΄΅ඇαϙʔτɻWindows… ࢖༻ྫ EFQFOET"QQMJDBUJPO4FSWJDFT$'/FUXPSL$PSF'PVOEBUJPO$PSF(SBQIJDT $PSF4FSWJDFT$PSF5FYU%JTL"SCJUSBUJPO'PVOEBUJPO*0,JU*NBHF*04FDVSJUZ EBSXJOMJCLFSOPTYQPTJY MBOHVBHF0CKFDUJWF$ QBDLBHFQMBUGPSN04-PH NPEVMFT04-PH DPNQJMFS0QUTGSBNFXPSL04-PH MJOLFS0QUTGSBNFXPSL04-PH 04-PHEFGͷத਎
  16. 20.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  17. 22.

    Kotlin → C/C++ # μΠφϛοΫϥΠϒϥϦ࡞੒ (staticͰ΋͍͍Ͱ͕͢) # libhello.dylib͕ग़དྷͯΔ͸ͣ $ clang++

    -shared hello.cc -fPIC -o libhello.dylib # klib (hello.klib) ੜ੒ $ cinterop -def libhello.def -o hello # ࣮ߦϑΝΠϧ (main.kexe) Λੜ੒ $ kotlinc-native main.kt -library hello -o main NBJOLU IFMMPDD IFMMPI MJCIFMMPEFG
  18. 23.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  19. 25.

    Flutter + Kotlin/NativeͷΫϩεϓϥοτϑΥʔϜ Kotlin/Nativeʹ͸PlatformLibrary΋͋Γɺ ֤ϓϥοτϑΥʔϜͷओཁݴޠʹInteropͰ͖ͦ͏ͩ Web (JavaScript) ͸ࢼͯ͠·ͤΜ͕ 6* 'MVUUFS

    "OESPJEݻ༗ +BWB,PUMJO ڞ௨ϩδοΫ ,PUMJO/BUJWF J04ݻ༗ 4XJGU0CKFDUJWF$ NBD04ݻ༗ 4XJGU0CKFDUJWF$FUD -JOVYݻ༗ $$ 8JOEPXTݻ༗ 8JO$ 8FCݻ༗ )5.- *OUFSPQ  LPUMJOD 1MBUGPSN$IBOOFMT *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODKT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT
  20. 27.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  21. 28.

    • Framework ‣ Android/iOSͷςʔϚΛαϙʔτ ‣ DartݴޠͰॻ͔ΕͨϑϨʔϜϫʔΫ ‣ ΢ΟδΣοτ΍Ξχϝʔγϣϯ౳Λ࣮ݱ • Engine

    ‣ Shellػೳ ‣ ϨϯμϦϯάػೳ ‣ Dart VM ‣ Platform Channels ɹͳͲ • Embedder ‣ ϝΠϯϧʔϓͷ෦෼ ‣ CPU΍άϥϑΟοΫε,ೖग़ྗ౳ͷPlatformҧ͍Λٵऩ 'SBNFXPSL %BSU $VQFSUJOP .BUFSJBM Flutter ΞʔΩςΫνϟ 8JEHFUT 3FOEFSJOH "OJNBUJPO 1BJOUJOH (FTUVSFT 'PVOEBUJPO &OHJOF $$ 4FSWJDF1SPUPDPM $PNQPTJUJPO 1MBUGPSN$IBOOFMT %BSU*TPMBUF4FUVQ %BSU7. .BOBHFNFOU 3FOEFSJOH 4ZTUFN&WFOUT 'SBNF4DIFEVMJOH "TTFU3FTPMVUJPO 'SBNF1JQFMJOJOH 5FYU-BZPVU &NCFEEFS 3FOEFS4VSGBDF4FUVQ /BUJWF1MVHJOT 1BDLBHJOH 5ISFBE4FUVQ &WFOU-PPQ*OUFSPQ 1MBUGPSN SEQBSUZ044 %BSU7. 4LJB 5YU ʜ 'MVUUFS"QQMJDBUJPO 7TZOD8BJUFS
  22. 29.

    Flutter ΞϓϦέʔγϣϯͷجຊతͳߏ੒ .Z"QQ 4UBUFMFTT8JEHFU SVO"QQ .BUFSJBM"QQ .Z)PNF1BHF 4UBUFGVM8JEHFU @.Z)PNF1BHF4UBUF 4UBUF.Z)PNF1BHF

    CVJME DSFBUF4UBUF NBJO ϓϩύςΟ 'MVUUFS'SBNFXPSL 8JEHFUͷߏங Πϕϯτॲཧ ϩδοΫ 4DB⒎PME "QQ#BS $FOUFS 5FYU TFU4UBUF SFCVJME
  23. 30.

    Flutter SDK͕࣮ݱ͍ͯ͠Δ͜ͱ ɾ%BSUίʔυΛόΠτίʔυʹม׵ ɹCVJMEJPTqVUUFS@BTTFUTLFSOFM@CMPCCJO ɾϓϥάΠϯͷϏϧυ ɾඞཁͳBTTFU΍GPOU౳ͷσʔλΛू໿ 92VBSU[ 'SBNFXPSL %BSU $VQFSUJPO

    .BUFSJBM 8JEHFUT 3FOEFSJOH "OJNBUJPO 1BJOUJOH (FTUVSFT 'PVOEBUJPO &OHJOF $$ 4FSWJDF1SPUPDPM $PNQPTJUJPO 1MBUGPSN$IBOOFMT %BSU*TPMBUF4FUVQ %BSU7. .BOBHFNFOU 3FOEFSJOH 4ZTUFN&WFOUT 'SBNF4DIFEVMJOH "TTFU3FTPMVUJPO 'SBNF1JQFMJOJOH 5FYU-BZPVU &NCFEEFS 3FOEFS4VSGBDF4FUVQ /BUJWF1MVHJOT 1BDLBHJOH 5ISFBE4FUVQ &WFOU-PPQ*OUFSPQ 1MBUGPSN SEQBSUZ044 %BSU7. 4LJB 5YU ʜ 'MVUUFS"QQMJDBUJPO 7TZOD8BJUFS ɾؔ࿈ϥΠϒϥϦΛϦϯΫ͠ɺ࣮ߦόΠφϦΛੜ੒ ɹ'MVUUFS&OHJOϥΠϒϥϦ ɹ΢Πϯυ΢ˍ6*ϑϨʔϜϫʔΫϥΠϒϥϦ ˞ϓϥοτϑΥʔϜຖʹϥΠϒϥϦ͸ҟͳΓ·͢ 0QFO(- qVUUFSCVJMECVOEMFίϚϯυ qVUUFSCVJME\UBSHFU^ίϚϯυ (-'8 $PDPB
  24. 31.

    Platform Channels (Dart ⁵ ωΠςΟϒݴޠͷݺͼग़͠) • Pluginܦ༝ͰΞΫηε ‣ ϓϥοτϑΥʔϜݻ༗ίʔυ ͸ඞͣϓϥάΠϯܦ༝

    ‣ MethodChannel/ EventChannelΛར༻ • ࢀߟ ‣ https://flutter.dev/docs/ development/platform- integration/platform-channels 'SBNFXPSL %BSU $VQFSUJPO .BUFSJBM 8JEHFUT 3FOEFSJOH "OJNBUJPO 1BJOUJOH (FTUVSFT 'PVOEBUJPO &OHJOF $$ 4FSWJDF1SPUPDPM $PNQPTJUJPO 1MBUGPSN$IBOOFMT %BSU*TPMBUF4FUVQ %BSU7. .BOBHFNFOU 3FOEFSJOH 4ZTUFN&WFOUT 'SBNF4DIFEVMJOH "TTFU3FTPMVUJPO 'SBNF1JQFMJOJOH 5FYU-BZPVU &NCFEEFS 3FOEFS4VSGBDF4FUVQ /BUJWF1MVHJOT 1BDLBHJOH 5ISFBE4FUVQ &WFOU-PPQ*OUFSPQ 1MBUGPSN SEQBSUZ044 %BSU7. 4LJB 5YU ʜ 'MVUUFS"QQMJDBUJPO 7TZOD8BJUFS /BUJWF 1MVHJO"1*
  25. 32.

    'MVUUFS 1MVHJO MethodChannel (Dart → Platform Native) 'MVUUFS 'SBNFXPSL %BSU

    'MVUUFS&OHJOF $ 1MBUGPSN +BWB,PUMJO 4XJGU 0CKFDUJWF$ $$ .FUIPE$IBOOFM JOWPLF.FUIPE 3FTVMU TVDDFTTFSSPSOPU*NQMFNFOUFE 1MBUGPSN$IBOOFMT "TZOD .FUIPE$IBOOFM TFU.FUIPE$BMM)BOEMFS 3FTVMU TVDDFTTFSSPSOPU*NQMFNFOUFE ˞1MBUGPSN ݴޠ ຖʹ "1*໊͕ҟͳΔͨΊ஫ҙ )BOEMF.FUIPE$BMM
  26. 33.

    'MVUUFS 1MVHJO EventChannel (Platform Native → Dart) 'MVUUFS 'SBNFXPSL %BSU

    'MVUUFS&OHJOF $ 1MBUGPSN +BWB,PUMJO 4XJGU 0CKFDUJWF$ $$ &WFOU$IBOOFM SFDFJWF#SPBEDBTU4USFBN &WFOU4JOL TVDDFTTFSSPSFOE0G4USFBN 1MBUGPSN$IBOOFMT "TZOD &WFOU$IBOOFM TFU4USFBN)BOEMFS &WFOU4JOL TVDDFTTFSSPSFOE0G4USFBN ˞1MBUGPSN ݴޠ ຖʹ "1*໊͕ҟͳΔͨΊ஫ҙ &WFOU$IBOOFM DBODFM 4USFBN)BOEFS PO$BODFM 4USFBN)BOEFS PO-JTUFO
  27. 34.

    • ֓ཁ ‣ Flutter + Kotlin/NativeͰ࣮ݱ͍ͨ͜͠ͱ ‣ Flutterͱ͸ʁ ‣ Kotlin/Nativeͱ͸ʁ

    • Kotlin/Nativeʹ͍ͭͯ ‣ ίϯύΠϥͷ࢖͍ํ (without Gradle) ‣ KotlinͱC/C++ͷ૬ޓࢀর (Interop) ‣ KotlinͱSwiftͷ૬ޓࢀর (Interop) • Flutterʹ͍ͭͯ • Flutter + Kotlin/Nativeͷࠓޙͷݟ௨͠ ࣍
  28. 35.

    ࠓࢼ͍ͯ͠Δ͜ͱ ·ͩ୭΋ࢼ͍ͯ͠ͳ͍ʁmacOSͱLinuxͰαϯϓϧΞϓϦ࡞੒ͯ͠τϥΠத → Linux͸ग़དྷ·ͨ͠ (͕࣌ؒ଍Γͳͯ͘ࢿྉԽग़དྷͣ…) → macOS͸frameworkͷϦϯΫΤϥʔͱ͔Xcodeͷܦݧෆ଍ͰۤઓதͰ͕͢ɺ͔͚࣌ؒΕ͹ग़དྷͦ͏ͳݟࠐΈ͋ΓͰ͢ 6* 'MVUUFS "OESPJEݻ༗

    +BWB,PUMJO ڞ௨ϩδοΫ ,PUMJO/BUJWF J04ݻ༗ 4XJGU0CKFDUJWF$ NBD04ݻ༗ 4XJGU0CKFDUJWF$FUD -JOVYݻ༗ $$ 8JOEPXTݻ༗ 8JO$ 8FCݻ༗ )5.- *OUFSPQ  LPUMJOD 1MBUGPSN$IBOOFMT *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODOBUJWF *OUFSPQ LPUMJODKT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT 1MBUGPSN$IBOOFMT
  29. 36.