Null-safety (#685)

This commit is contained in:
Luan Nico
2021-03-09 17:45:55 -05:00
committed by GitHub
parent 0855d4e3a5
commit edc54fdc34
121 changed files with 625 additions and 669 deletions

View File

@@ -21,7 +21,7 @@ void main() async {
class MyCollidable extends PositionComponent
with HasGameRef<MyGame>, Hitbox, Collidable {
Vector2 velocity;
late Vector2 velocity;
final _collisionColor = Colors.amber;
bool _isWallHit = false;
bool _isCollision = false;
@@ -35,7 +35,7 @@ class MyCollidable extends PositionComponent
@override
Future<void> onLoad() async {
final center = gameRef.size / 2;
final center = gameRef!.size / 2;
velocity = (center - position).normalized() * 150;
}