mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-15 04:09:43 +08:00
Small fixes and nits to make null-safe simpler (#686)
This commit is contained in:
@@ -15,14 +15,8 @@ void main() {
|
||||
class MyGame extends BaseGame with MultiTouchTapDetector {
|
||||
final _whitePaint = BasicPalette.white.paint;
|
||||
|
||||
Paint _paint;
|
||||
|
||||
final Map<int, Rect> _taps = {};
|
||||
|
||||
MyGame() {
|
||||
_paint = _whitePaint;
|
||||
}
|
||||
|
||||
@override
|
||||
void onTapDown(int pointerId, TapDownDetails details) {
|
||||
_taps[pointerId] = Rect.fromLTWH(
|
||||
@@ -47,7 +41,7 @@ class MyGame extends BaseGame with MultiTouchTapDetector {
|
||||
void render(Canvas canvas) {
|
||||
super.render(canvas);
|
||||
_taps.values.forEach((rect) {
|
||||
canvas.drawRect(rect, _paint);
|
||||
canvas.drawRect(rect, _whitePaint);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user