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
630
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
1k
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.3k
PORT_Firebase___Algolia.pdf
yshogo
0
220
Flutter_meetup_tokyo__10.pdf
yshogo
0
5.7k
PORT Firebase x Flutter
yshogo
0
370
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
500
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Speed Design
sergeychernyshev
24
610
Rails Girls Zürich Keynote
gr2m
94
13k
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Unsuck your backbone
ammeep
668
57k
Practical Orchestrator
shlominoach
186
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Why Our Code Smells
bkeepers
PRO
334
57k
Building Your Own Lightsaber
phodgson
103
6.1k
Optimizing for Happiness
mojombo
376
70k
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. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠