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
RepaintBoundary で Flutter のパフォーマンスを向上
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
mine2424
June 17, 2024
Programming
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RepaintBoundary で Flutter のパフォーマンスを向上
mine2424
June 17, 2024
More Decks by mine2424
See All by mine2424
Android 16KBページサイズ対応をはじめからていねいに
mine2424
1
11k
アニメーションを最深まで理解してパフォーマンスを向上させる
mine2424
0
1.3k
金融×キャリア教育で人生をシミュレーション
mine2424
0
140
実務2年目の学生がエンジニアとして働くことについて思ったこと
mine2424
0
150
Other Decks in Programming
See All in Programming
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
530
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
660
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
4
1.3k
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
数百円から始めるRuby電子工作
tarosay
0
130
VibeCodingからAgenticWorkflowへ
starfish719
0
230
テーブルをDELETEした
yuzneri
0
130
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
440
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
170
Cloudflare is Agents
chimame
0
100
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
140
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
480
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
108
250k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
240
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
360
Being A Developer After 40
akosma
91
590k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
920
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Utilizing Notion as your number one productivity tool
mfonobong
4
510
WENDY [Excerpt]
tessaabrams
11
39k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
830
Transcript
PUBLIC Flutter Meetup Tokyo #20 2024-06-17 RepaintBoundary で Flutter のパフォーマンスを向上
1
PUBLIC 自分を表す#(ハッシュタグ) みね (Ryota) # 奈良県出身 # ソフトテニス6年 # ポーカー1年
# F1 # 麻雀にはまり中 # 来年ポーカーの世界大会でます 経歴 大阪経済大学 経済学部卒 2024/4~ サイバーエージェント入社(24卒) X : nihon_kaizou github : mine2424 zenn: mine2424
PUBLIC RepaintBoundary とは? はみ出ている... 無駄なペンキ塗りが発生... 事前にテープを貼ろう!
PUBLIC RepaintBoundary とは? This widget creates a separate display list
for its child, which can improve performance if the subtree repaints at different times than the surrounding parts of the tree. 他と異なるタイミングで再描画される Widget を切り離す ex) animation, chart, CustomPaint, BackDropFilter etc… 頻繁に再描画されるもの
PUBLIC Deep Dive RepaintBoundary RenderObject とは? config, def state, lifecycle
painter
PUBLIC Deep Dive RepaintBoundary RenderObject.markNeedsPaint によって 描画が必要であるというフラグが立つ RenderObject.isRepaintBoundary を持つ一番近い祖先 である
RenderObject が再描画の対象となる (何も指定していないとアプリの root より子孫全てが再描画対象となる...) PaintingContext も同様
PUBLIC Deep Dive RepaintBoundary PaintingContext.paintChild() RenderObject.markNeedsPaint()
PUBLIC Deep Dive RepaintBoundary 実は Drawer にも RepaintBoundary が...! ref:
https://github.com/flutter/flutter/blob/5187cab7bdd434ca74abb45895d17e9fa553678a/packages/flutter/lib/src/material/drawer.dart#L690 DrawerControllerState
PUBLIC RepaintBoundary の使い所 Transform & ジャイロスコープ (sensors_plus)
PUBLIC RepaintBoundary の使い所
PUBLIC RepaintBoundary の使い所
PUBLIC RepaintBoundary の計測方法 Dev Tools の Flutter inspector より
PUBLIC RepaintBoundary の計測方法 main.dart にて 全ての RenderObject に対して timeline event
を生成 再描画箇所の 色が変わる!
PUBLIC まとめ • RepaintBoundary は異なるタイミングで再描画される widget と切り離すためにある • RenderObject 内で
どこで isRepaintBoundary が true に なっているかを見ている • debug によって直感的にも定量的にも使いどころが把握できる UI のパフォーマンスを向上させて 快適なアプリを構築!
PUBLIC END 15