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__7.pdf
Search
shogo.yamada
February 09, 2019
0
8k
Flutter_meetup__7.pdf
shogo.yamada
February 09, 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
980
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
360
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
490
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Design by the Numbers
sachag
278
19k
The Invisible Side of Design
smashingmag
297
50k
Building Better People: How to give real-time feedback that sticks.
wjessup
362
19k
BBQ
matthewcrist
85
9.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Agile that works and the tools we love
rasmusluckow
327
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
105
48k
Practical Orchestrator
shlominoach
186
10k
Designing with Data
zakiwarfel
98
5.1k
Code Review Best Practice
trishagee
62
16k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
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. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠