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だけでテトリス作ってみた
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aoi Umigishi
February 29, 2024
Programming
240
0
Share
Flutterだけでテトリス作ってみた
第2回Flutter Nightでの登壇資料です。
Aoi Umigishi
February 29, 2024
More Decks by Aoi Umigishi
See All by Aoi Umigishi
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
490
SliverAppBarはなぜ変化する?~ Sliverを内側から理解する ~
umigishiaoi
0
170
My challenge to add Vision OS support in Flutter
umigishiaoi
0
120
Other Decks in Programming
See All in Programming
10 Tips of AWS ~Gen AI on AWS~
licux
5
420
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
140
의존성 주입과 모듈화
fornewid
0
150
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
CDK Deployのための ”反響定位”
watany
4
790
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
2
480
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
感情を設計する
ichimichi
5
1.5k
t *testing.T は どこからやってくるの?
otakakot
1
690
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
480
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Balancing Empowerment & Direction
lara
6
1.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
170
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Are puppies a ranking factor?
jonoalderson
1
3.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Building the Perfect Custom Keyboard
takai
2
730
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Transcript
F l u t t e r だ け で
テ ト リ ス 作 っ て み た F lu t t e r N i ght ���� 年 �� 月 �� 日 Aoi Umigishi
アジェンダ �. 自己紹介 �. 作成したテトリスの紹介 �. 作成ポイント a. テトリスのモデル化 b.
キーボード入力 c. 状態管理 �. まとめ
名前: Aoi Umigishi ( 東 優太 ) SNS 等: 職業:
フリーランスエンジニア (Flutter/TypeScript) 趣味:音楽、ゲーム、 etc ... 自己紹介
作成したテトリスの紹介
作成したテトリスの紹介 特徴: 特徴: �rd Party のパッケージを不使用!
作成ポイント ・テトリスのモデル化 [(false , 黒 ), (true , 紫 ),
(false , 黒 )], [(true , 紫 ), (true , 紫 ), (true , 紫 )] [ ] List<List<PanelModel>> ブロックを PanelModel でモデル化 ブロックを PanelModel でモデル化
作成ポイント ・テトリスのモデル化 移動のロジック 移動後の Block の位置に hasBlock = true のものがないか
チェック なければ移動を実行
作成ポイント ・テトリスのモデル化 移動のロジック 移動後の Block の位置に hasBlock = true のものがないか
チェック あれば移動しない
作成ポイント ・キーボード入力 https://docs.flutter.dev/ui/ interactivity/actions-and-shortcuts Shortcuts, Actions, Focus の � つの
Widget で実現
作成ポイント ・キーボード入力
作成ポイント ・状態管理 親 ゲーム画面 ボタン FieldState 課題 : ゲーム画面の状態をボタンから操作したい currentMino
作成ポイント ・状態管理 親 ゲーム画面 ボタン FieldState 課題 : ゲーム画面の状態をボタンから操作したい
作成ポイント ・状態管理 (StatefulWidget) ゲーム画面 ボタン FieldState 解決方法 : InheritedWidget の利用
TetrisController down (InheritedWidget) _InheritedTetris TetrisController.of(context).fieldState TetrisController.of(context).down
・Flutter だけでテトリスを作りました ・パッケージを使わずとも標準 API で色々できます まとめ ・でも、パッケージはやっぱり便利。感謝。 ・他にも Dart �
の List.indexed とか活用してます ・ リポジトリ見てください!
ご清聴ありがとうございました!