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 meetup Tokyo #7
Search
shogo.yamada
January 30, 2019
1
270
Flutter meetup Tokyo #7
shogo.yamada
January 30, 2019
Tweet
Share
More Decks by shogo.yamada
See All by shogo.yamada
Jetpack ComposeへのリファクタリングのTIPS: CustomViewの便利な使い方 / Refactoring TIPS to Jetpack Compose: Useful usage of CustomView
yshogo
0
580
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
970
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.2k
PORT_Firebase___Algolia.pdf
yshogo
0
220
Flutter_meetup_tokyo__10.pdf
yshogo
0
5.7k
PORT Firebase x Flutter
yshogo
0
350
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
50
Potetochips #61
yshogo
1
490
Featured
See All Featured
Atom: Resistance is Futile
akmur
261
25k
Being A Developer After 40
akosma
84
590k
Building Adaptive Systems
keathley
37
2.1k
Six Lessons from altMBA
skipperchong
26
3.4k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.7k
Teambox: Starting and Learning
jrom
131
8.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
25
640
Building Better People: How to give real-time feedback that sticks.
wjessup
360
19k
Docker and Python
trallard
40
3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
91
16k
Visualization
eitanlees
143
15k
Transcript
Copyright © ZOZO Technologies, Inc. All Rights Reserved. גࣜձࣾ;0;0ςΫϊϩδʔζ ։ൃ෦
ࢁాঘޗ 8JEHFUੜͷύϑΥʔϚϯε Λվળ͢Δ
ϓϩϑΟʔϧ 5XJUUFS ;0;0ςΫϊϩδʔζ ։ൃ෦ ࢁాঘޗ Copyright © ZOZO Technologies, Inc.
All Rights Reserved. !ZTIPHP (JUIVC !ZTIPHP 'MVUUFSใൃ৴ϒϩά IUUQTOPUFNVTIPHPZBNBEB
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ˓ຊ࠷େڃͷϑΝογϣϯγϣοϐϯάαΠτΞϓϦ ˓
Ҏ্ͷγϣοϓɺ Ҏ্ͷϒϥϯυͷऔΓѻ͍ʢ ݄࣌ʣ ˓ৗ࣌ສҎ্ͷΞΠςϜͱຖฏۉ Ҏ্ͷ৽ண Λܝࡌ ˓ଈૹαʔϏεΪϑτϥοϐϯάαʔϏεπέ͍ͳͲ IUUQ[P[PKQ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ˓ຊ࠷େڃͷϑΝογϣϯίʔσΟωʔτΞϓϦ ˓
ສμϯϩʔυಥഁɺίʔσΟωʔτߘ૯ສ݅Ҏ ্ʢͱʹ݄࣌ʣ ˓શੈքʢ"QQ4UPSF(PPHMFQMBZ͕ར༻ՄೳͳશͯͷࠃʣͰμ ϯϩʔυ͕Մೳ ˓ສਓҎ্ͷϑΥϩϫʔΛ࣋ͭϢʔβʔʢ8&"3*45"ʣੜ IUUQTXFBSKQ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ˓ʮ;0;046*5ʯͰܭଌͨ͠ମܕσʔλΛͱʹɺҰਓͻͱΓͷମ ܕʹ߹ͬͨʮ͋ͳͨαΠζʯͷΞΠςϜ
˓ʮڀۃͷϑΟοτײʯΛ࣮ݱͨ͠ϕʔγοΫΞΠςϜΛఏڙ άϩʔόϧαΠτʮ;0;0DPNʯͰւ֎ల։ ˓ΞΠςϜ̩γϟπɺσχϜύϯπɺγϟπɺϏδωεεʔπɺ ωΫλΠɺϘʔμʔ̩γϟπɺକΫϧʔωοΫ̩γϟπͳͲ IUUQ[P[PKQQC
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ˓͕ࣾಠࣗʹ։ൃͨ͠࠾ੇ༻ϘσΟʔεʔπ ˓શମʹࢪ͞ΕͨυοτϚʔΧʔΛεϚʔτϑΥϯΧϝϥͰࡱ
Ө͢Δ͜ͱͰɺମܕσʔλΛܭଌ ˓ܭଌͨ͠ମܕσʔλɺॠ࣌ʹ%ϞσϧԽ͞Εɺ;0;0508/Ξ ϓϦʹอଘɻ%Ϟσϧ͋ΒΏΔ֯ʹಈ͔͢͜ͱ͕Ͱ͖ɺମܕΛ νΣοΫ͢Δ͜ͱ͕Մೳ IUUQ[P[PKQ[P[PTVJU
Copyright © ZOZO Technologies, Inc. All Rights Reserved. εϙϯαʔϒʔεग़͠·͢ʂ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ࠓ͢͜ͱ ɾͳͥΔͷ͔
ɾύϑΥʔϚϯε͕ѱ͘ͳΔݪҼʁ ɾύϑΥʔϚϯεͷଌఆํ๏ ɾύϑΥʔϚϯε͕ѱ͘ͳΔΞϯνύλʔϯ ɾ·ͱΊ ɾ࠷ޙʹ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ͳͥΔͷ͔ ઌνϟοτΞϓϦΛϦϦʔε͠·ͨ͠ɻ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ͳͥΔͷ͔ Androidͷ֨҆εϚϗͰಈ͔͢ͱͨΒͱΧΫπΫɻ
ݪҼΛௐࠪͯ͠վળ͍ͨ͠
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯε͕ѱ͘ͳΔݪҼʁ https://docs.flutter.io/flutter/widgets/StatefulWidget-class.html#performance-considerations
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯε͕ѱ͘ͳΔݪҼʁ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯε͕ѱ͘ͳΔݪҼʁ Widgetͷੜճଟ͍
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯε͕ѱ͘ͳΔݪҼʁ Widgetͷੜճଟ͍
→WidgetੜճΛͰ͖Δ͚ͩݮΒ͢ ʢཧ࠷ॳͷҰճ͚ͩ)
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεͷଌఆํ๏ ᶃ
ᶄ ᶅ ᶆ Widget͕ͲΕ͘Β͍ ࠶ੜ͍ͯ͠Δͷ͔ΈΕΔ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεͷଌఆํ๏ γϯϓϧͳListView
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεͷଌఆํ๏ վળલ
վળޙ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips ɾsetState({})ΛΘͳ͍
ɾStateless WidgetΛ͏ ɾมߋ͕ͳ͍WidgetʹconstΛ͚ͭΔ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips setState({})Λଟ༷͍ͯ͠Δ
ɾStatefullWidgetͷbuild͔ΒWidgetΛ ࠶ੜͯ͠͠·͏ ɾجຊతʹsetState({})Θͳ͍Α͏ʹ࣮ ͢Δ͖
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips FutureBuilder
OR StreamBuilderΛ͏
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips setState({})Λ͏໘
ɾBottomNavigationɺSidebarͳͲɺ ҙਤతʹbuildԼͷWidgetΛॻ͖͑Δͱ ͖͚ͩʹ͏
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips ͱ͍͑ɺsetState({})͍͍ͨɺɺɺ
ɾͲ͏͍͍ͯͨ͠߹ɺมԽ͠ͳ͍෦Λ Stateless WidgetʹΓग़ͯ͠buildԼΛখ͘͢͞ Δ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. StatelessWidget StatefullWidget
มԽ͠ͳ͍Widget
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips Stateless
WidgetΛ͏ ɾมԽ͠ͳ͍෦ → Stateless Widgetʹ͢Δ ɾมԽ͢Δ෦͚ͩ → Statefull Widgetʹ͢Δ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ύϑΥʔϚϯεΛվળ͢ΔTips มߋ͕ͳ͍WidgetʹconstΛ͚ͭΔ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ·ͱΊ ɾsetState({})Ͱ͖Δ͚ͩ͏Θͳ͍
ɹ̍ɺ͏ͱ͖ҙਤతʹWidgetΛมߋ͢Δͱ͖ ɹ̎ɺFutureBuilder StreamBuilderΛ͏ ɹ̏ɺ͏߹Stateless WidgetʹΓग़ͯ͠ buildԼΛখ͘͢͞Δ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ·ͱΊ ɾStateless
WidgetͬͯҰੜͨ͠Βมߋͳ͍ ͷΛΘ͚Δ ɾconstΛͬͯɺWidgetΛΩϟογϡ͢Δ
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ࠷ޙʹ ɾͥͻʮKyatʯΛμϯϩʔυ͍ͯͩ͘͠͞
Copyright © ZOZO Technologies, Inc. All Rights Reserved. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠