Migrate examples to null-safety (#707)

This commit is contained in:
Luan Nico
2021-03-24 19:04:33 -04:00
committed by GitHub
parent 98e8515518
commit 640bfea941
34 changed files with 146 additions and 145 deletions

View File

@ -20,14 +20,14 @@ class LogoCompomnent extends SpriteComponent with HasGameRef<DebugGame> {
final rect = toRect();
if ((x <= 0 && xDirection == -1) ||
(rect.right >= gameRef.size.x && xDirection == 1)) {
(rect.right >= gameRef!.size.x && xDirection == 1)) {
xDirection = xDirection * -1;
}
y += yDirection * speed * dt;
if ((y <= 0 && yDirection == -1) ||
(rect.bottom >= gameRef.size.y && yDirection == 1)) {
(rect.bottom >= gameRef!.size.y && yDirection == 1)) {
yDirection = yDirection * -1;
}
}