mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 00:17:20 +08:00
chore: Update min Dart constraint to 3.8 (#3676)
Update min Dart constraint to 3.8, which will enable us to use the fancier collection literals. This requires bumping the min Flutter version as well: <img width="1892" height="1122" alt="image" src="https://github.com/user-attachments/assets/7c7b07fc-4d96-4987-824d-9a7133ecfb85" />
This commit is contained in:
@ -92,12 +92,12 @@ class RoundedButton extends PositionComponent with TapCallbacks {
|
||||
super.position,
|
||||
super.anchor = Anchor.center,
|
||||
}) : _textDrawable = TextPaint(
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Color(0xFF000000),
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
).toTextPainter(text) {
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Color(0xFF000000),
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
).toTextPainter(text) {
|
||||
size = Vector2(150, 40);
|
||||
_textOffset = Offset(
|
||||
(size.x - _textDrawable.width) / 2,
|
||||
@ -186,15 +186,15 @@ abstract class SimpleButton extends PositionComponent with TapCallbacks {
|
||||
class BackButton extends SimpleButton
|
||||
with HasGameReference<RouterWorldExample> {
|
||||
BackButton()
|
||||
: super(
|
||||
Path()
|
||||
..moveTo(22, 8)
|
||||
..lineTo(10, 20)
|
||||
..lineTo(22, 32)
|
||||
..moveTo(12, 20)
|
||||
..lineTo(34, 20),
|
||||
position: Vector2.all(10),
|
||||
);
|
||||
: super(
|
||||
Path()
|
||||
..moveTo(22, 8)
|
||||
..lineTo(10, 20)
|
||||
..lineTo(22, 32)
|
||||
..moveTo(12, 20)
|
||||
..lineTo(34, 20),
|
||||
position: Vector2.all(10),
|
||||
);
|
||||
|
||||
@override
|
||||
void action() => game.router.pop();
|
||||
@ -203,14 +203,14 @@ class BackButton extends SimpleButton
|
||||
class PauseButton extends SimpleButton
|
||||
with HasGameReference<RouterWorldExample> {
|
||||
PauseButton()
|
||||
: super(
|
||||
Path()
|
||||
..moveTo(14, 10)
|
||||
..lineTo(14, 30)
|
||||
..moveTo(26, 10)
|
||||
..lineTo(26, 30),
|
||||
position: Vector2(60, 10),
|
||||
);
|
||||
: super(
|
||||
Path()
|
||||
..moveTo(14, 10)
|
||||
..lineTo(14, 30)
|
||||
..moveTo(26, 10)
|
||||
..lineTo(26, 30),
|
||||
position: Vector2(60, 10),
|
||||
);
|
||||
|
||||
bool isPaused = false;
|
||||
|
||||
@ -353,12 +353,12 @@ class Orbit extends CircleComponent {
|
||||
required this.planet,
|
||||
required this.revolutionPeriod,
|
||||
}) : super(
|
||||
children: [planet],
|
||||
anchor: Anchor.center,
|
||||
paint: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..color = const Color(0x888888aa),
|
||||
);
|
||||
children: [planet],
|
||||
anchor: Anchor.center,
|
||||
paint: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..color = const Color(0x888888aa),
|
||||
);
|
||||
|
||||
final double revolutionPeriod;
|
||||
final Planet planet;
|
||||
|
||||
Reference in New Issue
Block a user