Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Flutterだけでテトリス作ってみた
Search
Aoi Umigishi
February 29, 2024
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
560
SliverAppBarはなぜ変化する?~ Sliverを内側から理解する ~
umigishiaoi
0
190
My challenge to add Vision OS support in Flutter
umigishiaoi
0
150
Other Decks in Programming
See All in Programming
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
130
setup-vp GitLab対応の裏側
naokihaba
0
110
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
180
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
180
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
App Intentsのビルドプロセスを支える技術
kntkymt
0
390
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
440
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
Intent as Code
shoppingjaws
6
1k
What We Talk About When We Talk About XP
m_seki
2
650
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
Featured
See All Featured
From π to Pie charts
rasagy
1
370
How to train your dragon (web standard)
notwaldorf
97
6.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Making the Leap to Tech Lead
cromwellryan
135
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Technical Leadership for Architectural Decision Making
baasie
3
570
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
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 とか活用してます ・ リポジトリ見てください!
ご清聴ありがとうございました!