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

Exploring Flutter in Android

takahirom
April 18, 2018
3.5k

Exploring Flutter in Android

takahirom

April 18, 2018
Tweet

Transcript

  1. &YQMPSJOH'MVUUFS
    JO"OESPJE
    UBLBIJSPN

    View full-size slide

  2. "CPVU.F
    ˖ UBLBIJSPN !OFX@SVOOBCMF

    ˖ .FOKV5BLBIJSP
    ˖ *MJLF"OESPJE
    ˖ "OESPJE%FWFMPQFSBU"CFNB57
    ˖ 'MVUUFSCFHJOOFS

    View full-size slide

  3. *OTJEFBQL
    ˖ TOBQTIPU
    ˖ VUUFSOBUJWFMJCSBSZ
    ˖ 8IBUJTJOUIFEFYMF

    View full-size slide

  4. )PXUPCVJMEVUUFS"OESPJEBQL
    ˖ IUUQTVUUFSJPBOESPJESFMFBTF
    3VOˑVUUFSCVJMEBQL˒

    View full-size slide

  5. 8IFSFJTˑVUUFS˒DPNNBOE
    ˖ IUUQTHJUIVCDPNVUUFSVUUFSCMPC
    FBDEDEFGGDBDBEDGBCQBDLBHFTVUUFS@UPPMT
    MJCFYFDVUBCMFEBSU
    *GPVOEJUJO'MVUUFS(JU)VCSFQPTJUPSZ
    VUUFSVUUFSQBDLBHFTVUUFS@UPPMTMJCFYFDVUBCMFEBSU

    View full-size slide

  6. VUUFSCVJMEBQL
    ˖ -FUˏTEFCVHHJOHˑVUUFSCVJMEBQL˒

    View full-size slide

  7. 8IBUJT'MVUUFSEPJOH
    BUCVJMEUJNF
    3VOˑHSBEMFXBTTFNCMF3FMFBTF˒
    qVUUFSCVJMEBQL

    View full-size slide

  8. 8IBUJT'MVUUFSEPJOH
    BUCVJMEUJNF
    qVUUFSCVJMEBQL
    HSBEMFXBTTFNCMF3FMFBTF
    3VOˑBQQVUUFS#VJME3FMFBTF˒

    View full-size slide

  9. 8IBUJT'MVUUFSEPJOH
    BUCVJMEUJNF
    qVUUFSCVJMEBQL
    HSBEMFXBTTFNCMF3FMFBTF
    (SBEMFqVUUFS#VJME3FMFBTFUBTLT
    project.exec {
    executable flutterExecutable.absolutePath
    workingDir sourceDir
    if (localEngine != null) {
    args "--local-engine", localEngine
    args "--local-engine-src-path", localEngineSrcPath
    }
    args "build", "aot"
    VUUFSQBDLBHFTVUUFS@UPPMTHSBEMFVUUFSHSBEMF
    3VOˑVUUFSCVJMEBPU˒

    View full-size slide

  10. 8IBUJT'MVUUFSEPJOH
    BUCVJMEUJNF
    qVUUFSCVJMEBQL
    HSBEMFXBTTFNCMF3FMFBTF
    qVUUFSCVJMEBPU
    (SBEMFqVUUFS#VJME3FMFBTFUBTLT
    final List genSnapshotCmd = [
    genSnapshot,
    '--await_is_keyword',
    '--vm_snapshot_data=$vmSnapshotData',

    VUUFSQBDLBHFTVUUFS@UPPMTMJCTSDDPNNBOETCVJME@BPUEBSU

    View full-size slide

  11. 8IBUJT'MVUUFSEPJOH
    BUCVJMEUJNF
    qVUUFSCVJMEBQL
    HSBEMFXBTTFNCMF3FMFBTF
    qVUUFSCVJMEBPU
    HFO@TOBQTIPU
    (SBEMFqVUUFS#VJME3FMFBTFUBTLT
    8IBUJTTOBQTIPU

    View full-size slide

  12. 8IBUJTTOBQTIPU
    ˖ "05DPNQJMFECJOBSZJO'MVUUFS
    ˖ 'BTUFSJOJUJBMJ[BUJPO
    ˖ 5IFDPEFBOEUIFSFBEPOMZEBUBBSF
    NBQQFEJOUPNFNPSZGSPNUIFCJOBSZ
    ˖ IUUQTHJUIVCDPNEBSUMBOHTELXJLJ4OBQTIPUT
    ˖ "05DPNQJMJOH%BSUGPSJ04"OESPJE %BSU%FWFMPQFS4VNNJU

    IUUQTXXXZPVUVCFDPNXBUDI WMR&VT*JL

    View full-size slide

  13. )PXEPFTJUXPSLJO"OESPJE
    ˖ %FCVHˑVUUFSSVO˒

    View full-size slide

  14. )PXEPFTJUXPSLJO"OESPJE
    ˖ -FUˏTEFCVHHJOHˑVUUFSSVO˒

    View full-size slide

  15. )PXEPFTJUXPSLJO"OESPJE
    ˖ ˑBECTIFMMBNTUBSU˒
    ˖ IUUQTHJUIVCDPNVUUFSVUUFSCMPCDFCCGEFCCQBDLBHFTVUUFS@UPPMTMJCTSDBOESPJE
    BOESPJE@EFWJDFEBSU-

    View full-size slide

  16. )PXEPFTJUXPSLJO"OESPJE
    public class FlutterApplication extends Application {
    @Override
    @CallSuper
    public void onCreate() {
    super.onCreate();
    FlutterMain.startInitialization(this);
    }
    System.loadLibrary("flutter");
    -PBEMJCVUUFSTP
    'MVUUFS.BJOTUBSU*OJUJBMJ[BUJPO

    View full-size slide

  17. )PXEPFTJUXPSLJO"OESPJE
    FlutterView
    ˖ IUUQTHJUIVCDPNVUUFSFOHJOFCMPCCECFBCBCCDDCGEBCDTIFMM
    QMBUGPSNBOESPJEJPVUUFSWJFX'MVUUFS7JFXKBWB
    ˖ IUUQTHJUIVCDPNVUUFSFOHJOFCMPCCECFBCBCCDDCGEBCDTIFMM
    QMBUGPSNBOESPJEJPVUUFSBQQ'MVUUFS"DUJWJUZ%FMFHBUFKBWB-
    setContentView
    4IPX'MVUUFS7JFX

    View full-size slide

  18. )PXEPFT'MVUUFSEPIPUSFMPBE
    ˖ %FCVHˑVUUFSSVO˒
    ˖ 5ZQFˑS˒
    ˖ $PNQJMFNBJOEBSUUPCVJMEBQQEJMM
    ˖ IUUQTHJUIVCDPNVUUFSVUUFSCMPC
    BGBCDGEEECFFDBFBGGCGQBDLBHFTVUUFS@UPPMT
    MJCTSDEFWGTEBSU-

    View full-size slide

  19. 8IBUJTBQQEJMM
    ˖ %BSU,FSOFM
    ˖ "TNBMMIJHIMFWFMMBOHVBHFEFSJWFEGSPN%BSU
    ˖ *OUFSNFEJBUFGPSNBUGPSXIPMFQSPHSBNBOBMZTJTBOE
    USBOTGPSNBUJPOT BOEBTBGSPOUFOEGPSDPEFHFOBOE
    FYFDVUJPOCBDLFOET
    ˖ IUUQTHJUIVCDPNEBSUMBOHTELUSFF
    FFBFBCBGDCBFGEBBQLHLFSOFM
    ˖ IUUQTHJUIVCDPNEBSUMBOHTELXJLJ,FSOFM%PDVNFOUBUJPO

    View full-size slide

  20. )PXUPEFCVH
    MJCVUUFSTP

    View full-size slide

  21. MJCVUUFSTP
    ˖ 5IF'MVUUFS&OHJOFJTBQPSUBCMFSVOUJNF

    GPSIPTUJOH'MVUUFSBQQMJDBUJPOT
    ˖ IUUQTHJUIVCDPNVUUFSFOHJOF
    IFSF
    JNBHFGSPNIUUQTVUUFSJPUFDIOJDBMPWFSWJFX

    View full-size slide

  22. %FCVHHJOH'MVUUFS&OHJOF
    ˖ -FUˏTCVJMEVUUFSFOHJOF UIJTUBLFTPNFIPVST

    ˖ IUUQTHJUIVCDPNVUUFSFOHJOFCMPCNBTUFS$0/53*#65*/(NE
    ˖ "EEMPHUP'MVUUFS&OHJOF

    View full-size slide

  23. %FCVHHJOH'MVUUFS&OHJOF
    ˖ VUUFSSVOMPDBMFOHJOFTSDQBUI6TFSTUBLBIJSPNHJU
    FOHJOFTSDˋMPDBMFOHJOFBOESPJE@EFCVH@VOPQU
    ˖ (SBEMFCVJME ˖ VUUFSSVO

    View full-size slide

  24. %FCVHHJOH'MVUUFS&OHJOF
    ˖ -PPLVUUFSDPOTPMF:PVDBOTFFUIFMPH
    ˖ 1MFBTFUFMMNFJGZPVLOPXIPXUPBUUBDIEFCVHHFS

    View full-size slide

  25. 4VNNBSZ
    ˖ %POPUCFBGSBJECFDBVTFZPVDBOSFBEBOESVO'MVUUFS
    ˖ 'MVUUFSVTFT%BSU4OBQTIPUBOE%BSU,FSOFM
    ˖ 'MVUUFSJTIBDLBCMF
    ˖ 1MFBTFUFMMNFJGUIFSFJTBOZNJTUBLF

    View full-size slide