Flutter Lifecycle

88bafea012650d494763bf1e1854d809?s=47 slime-a777
October 17, 2018

Flutter Lifecycle

88bafea012650d494763bf1e1854d809?s=128

slime-a777

October 17, 2018
Tweet

Transcript

  1. 'MVUUFSͷMJGFDZDMF 'MVUUFS.FFUVQ5PLZP !TMJNF@B

  2. ࣗݾ঺հ w ௕ඌಯ࢙ !TMJNF@B  w /55ςΫϊΫϩεॴଐ w ओʹ"OESPJEΤϯδχΞ

  3. 'MVUUFSͷMJGFDZDMF

  4. ֬ೝํ๏ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver { @override void

    didChangeAppLifecycleState(AppLifecycleState state) { print('*** state = ${state.toString()}'); } @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); } @override void dispose() { super.dispose(); WidgetsBinding.instance.removeObserver(this); }
  5. MJGFDZDMFͷύλʔϯ w JOBDUJWF w ΞϓϦ͕ඇΞΫςΟϒͰ͋ΓɺϢʔβͷೖྗΛड͚෇͚ͳ͍ঢ়ଶ w ΞϓϦΛόοΫάϥ΢ϯυʹҠߦͨ͠Γɺి࿩ʹԠ౴ͨ͠ΓɺΞ ϓϦΛ੾Γସ͑ͨΓ͍ͯ͠Δ్தஈ֊ʹ͓͍ͯ͜ͷঢ়ଶʹҠߦ͢ Δ w

    "OESPJEͷMJGFDZDMFʹ͸JOBDUJWFʹ֘౰͢Δঢ়ଶ͸ͳ͍ w QBVTFE w ΞϓϦέʔγϣϯͷҰ࣌ఀࢭঢ়ଶɻϢʔβͷೖྗʹԠ౴ͤͣɺόο Ϋάϥ΢ϯυͰ࣮ߦ͞ΕΔ
  6. MJGFDZDMFͷύλʔϯ w SFTVNF w ΞϓϦέʔγϣϯ͕දࣔ͞ΕɺϢʔβͷೖྗʹԠ౴͢ Δঢ়ଶ w TVTQFOEJOH w ΞϓϦέʔγϣϯ͕தஅ͞Ε͍ͯΔঢ়ଶ

    w J04Ͱ͸͜ͷঢ়ଶ͸ݱࡏ࢖༻͞Ε͍ͯͳ͍
 "OESPJEͰ΋ࣗ෼͸֬ೝͰ͖͍ͯͳ͍
  7. MJGFDZDMFΠϝʔδ J04 ఀࢭঢ়ଶ XJMM'JOJTI-BVODIJOH8JUI0QUJPOT EJE'JOJTI-BVODIJOH8JUI0QUJPOT BQQMJDBUJPO%JE#FDPNF"DUJWF ΞΫςΟϒঢ়ଶ ఀࢭঢ়ଶ ΞΫςΟϒঢ়ଶ SFTVNFE

  8. MJGFDZDMFΠϝʔδ J04 όοΫάϥ΢ϯυঢ়ଶ BQQMJDBUJPO8JMM&OUFS'PSFHSPVOE BQQMJDBUJPO%JE#FDPNF"DUJWF ΞΫςΟϒঢ়ଶ BQQMJDBUJPO8JMM3FTJHO"DUJWF BQQMJDBUJPO%JE&OUFS#BDLHSPVOE όοΫάϥ΢ϯυঢ়ଶ όοΫάϥ΢ϯυঢ়ଶ

    ΞΫςΟϒঢ়ଶ όοΫάϥ΢ϯυঢ়ଶ JOBDUJWF SFTVNFE JOBDUJWF QBVTFE
  9. MJGFDZDMFΠϝʔδ "OESPJE ఀࢭঢ়ଶ PO$SFBUF PO4UBSU PO3FTVNF ΞΫςΟϒঢ়ଶ ఀࢭঢ়ଶ ΞΫςΟϒঢ়ଶ PO1PTU3FTVNF

  10. MJGFDZDMFΠϝʔδ "OESPJE όοΫάϥ΢ϯυঢ়ଶ PO4UBSU PO3FTVNF ΞΫςΟϒঢ়ଶ όοΫάϥ΢ϯυঢ়ଶ ΞΫςΟϒঢ়ଶ SFTVNFE PO1PTU3FTVNF

    PO1BVTF όοΫάϥ΢ϯυঢ়ଶ JOBDUJWF όοΫάϥ΢ϯυঢ়ଶ JOBDUJWF QBVTFE PO4UPQ
  11. ॴײ w EJE$IBOHF"QQ-JGFDZDMF4UBUF͸
 ϑΥΞάϥ΢ϯυ㱻όοΫάϥ΢ϯυͷ
 ϥΠϑαΠΫϧ؅ཧʹ׆༻͢Δͷ͕Α͍ w ىಈ࣌ॲཧͳͲ͸JOJU4UBUFͳͲΛ׆༻͢Δ