Skip to content

Commit 353cc80

Browse files
committed
Fix build
1 parent 8f5bc3f commit 353cc80

File tree

14 files changed

+18
-17
lines changed

14 files changed

+18
-17
lines changed

lib/features/about/screen/about_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class AboutScreen extends StatelessWidget {
107107
}
108108
}
109109

110-
static final _titleAlphaColor = (255.0 * 0.5) as int;
110+
static final _titleAlphaColor = (255.0 * 0.5).toInt();
111111
static const _githubUrl = 'https://github.com/lucasnlm/antimine-android/';
112112
static const _videoUrl =
113113
'https://open.spotify.com/artist/5Z1PXKko20wSH0yFr9HtNr';

lib/features/controls/widgets/control_divider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ class ControlDivider extends StatelessWidget {
1717
);
1818
}
1919

20-
static final _controlDividerAlpha = (255.0 * 0.25) as int;
20+
static final _controlDividerAlpha = (255.0 * 0.25).toInt();
2121
}

lib/features/dialogs/game_over_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ class GameOverDialog extends StatelessWidget {
120120
);
121121
}
122122

123-
static final _titleAlphaColor = (255.0 * 0.7) as int;
123+
static final _titleAlphaColor = (255.0 * 0.7).toInt();
124124
}

lib/features/dialogs/victory_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class _VictoryDialogState extends State<VictoryDialog> {
182182

183183
double _degToRad(double deg) => deg * (pi / 180.0);
184184

185-
static final _titleAlphaColor = (255.0 * 0.7) as int;
185+
static final _titleAlphaColor = (255.0 * 0.7).toInt();
186186
static const _numberOfParticles = 5;
187187
static const _gravity = 0.1;
188188
static const _emissionFrequency = 0.05;

lib/features/game/flame/components/hover_component.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ class HoverComponent extends ShapeComponent
6868
_expansion = max(_expansion - _expansionSpeed * dt, 0.0);
6969
final color = theme.cover
7070
.darken(0.1)
71-
.withAlpha((_opacity * 255.0) as int);
71+
.withAlpha((_opacity * _maxAlpha).toInt());
7272
paint.colorFilter = ColorFilter.mode(color, BlendMode.srcIn);
7373
} else {
7474
_opacity = min(_opacity + _expansionSpeed * dt, _maxOpacity);
7575
_expansion = min(_expansion + _expansionSpeed * dt, _maxExpansion);
7676
final color = theme.cover
7777
.darken(0.1)
78-
.withAlpha((_opacity * 255.0) as int);
78+
.withAlpha((_opacity * _maxAlpha).toInt());
7979
paint.colorFilter = ColorFilter.mode(color, BlendMode.srcIn);
8080
}
8181
}
@@ -104,6 +104,7 @@ class HoverComponent extends ShapeComponent
104104
);
105105
}
106106

107+
static const _maxAlpha = 255.0;
107108
static const _spriteSizeExpanded = ComponentConstants.spriteSize * 0.05;
108109
static const _maxExpansion = 0.5;
109110
static const _maxOpacity = 0.5;

lib/features/game/logic/game_constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GameConstants {
1616
static const confettiDuration = Duration(seconds: 3);
1717
static const hintReward = 5;
1818
static const initialHintCount = 5;
19-
static final revealedOpacity = (0.6 * 255.0) as int;
19+
static final revealedOpacity = (0.6 * 255.0).toInt();
2020
static const dimOpacity = 127;
2121

2222
static const safeAreaEnabled = true;

lib/features/game/screen/game_params.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class GameParams extends Equatable {
7373
restart: object[_restartKey] ?? false,
7474
difficulty:
7575
object[_difficultyKey] != null
76-
? Difficulty.values[object[_difficultyKey] as int]
76+
? Difficulty.values[object[_difficultyKey].toInt()]
7777
: null,
7878
seed: object[_seedKey],
7979
saveId: object[_saveIdKey],

lib/features/game/widgets/action_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ class ActionButton extends StatelessWidget {
6262
);
6363
}
6464

65-
static final _buttonAlphaSurface = (0.7 * 255.0) as int;
65+
static final _buttonAlphaSurface = (0.7 * 255.0).toInt();
6666
}

lib/features/game/widgets/action_card.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ class ActionCard extends StatelessWidget {
4242
);
4343
}
4444

45-
static final _actionBorderAlpha = (255.0 * 0.1) as int;
46-
static final _actionSurfaceAlpha = (255.0 * 0.5) as int;
45+
static final _actionBorderAlpha = (255.0 * 0.1).toInt();
46+
static final _actionSurfaceAlpha = (255.0 * 0.5).toInt();
4747
}

lib/features/game/widgets/highlight_container.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ class HighlightContainer extends StatelessWidget {
4141
);
4242
}
4343

44-
static final _actionBorderAlpha = (255.0 * 0.1) as int;
44+
static final _actionBorderAlpha = (255.0 * 0.1).toInt();
4545
}

0 commit comments

Comments
 (0)