chore: Update to Flutter 3.13 (#2656)

Updates the pipeline to use Flutter 3.13 and does all the analyze fixes.
This commit is contained in:
Lukas Klingsbo
2023-08-18 20:13:17 +02:00
committed by GitHub
parent d08284ddca
commit 9887892493
48 changed files with 53 additions and 53 deletions

View File

@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
flutter-version: '3.13.0'
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@main
@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
flutter-version: '3.13.0'
channel: 'stable'
- uses: bluefireteam/melos-action@v2
- name: "Analyze"
@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
flutter-version: '3.13.0'
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@main

View File

@ -38,7 +38,7 @@ class AnchorGame extends FlameGame {
radius: 4,
position: size / 2,
anchor: Anchor.center,
)
),
]);
}

View File

@ -397,7 +397,7 @@ class PausePage extends Component with TapCallbacks, HasGameRef<RouterGame> {
alternate: true,
infinite: true,
),
)
),
],
),
]);

View File

@ -61,7 +61,7 @@ class KlondikeGame extends FlameGame {
final cards = [
for (var rank = 1; rank <= 13; rank++)
for (var suit = 0; suit < 4; suit++) Card(rank, suit)
for (var suit = 0; suit < 4; suit++) Card(rank, suit),
];
cards.shuffle();
world.addAll(cards);

View File

@ -59,7 +59,7 @@ class TRexGame extends FlameGame
ascent: 23,
glyphs: [
for (var i = 0; i < chars.length; i++)
Glyph(chars[i], left: 954.0 + 20 * i, top: 0, width: 20)
Glyph(chars[i], left: 954.0 + 20 * i, top: 0, width: 20),
],
),
letterSpacing: 2,

View File

@ -27,7 +27,8 @@ class BlobExample extends Forge2DGame with TapDetector {
..collideConnected = false;
await addAll([
for (var i = 0; i < 20; i++) BlobPart(i, jointDef, blobRadius, blobCenter)
for (var i = 0; i < 20; i++)
BlobPart(i, jointDef, blobRadius, blobCenter),
]);
world.createJoint(ConstantVolumeJoint(world, jointDef));
}

View File

@ -40,7 +40,7 @@ class PulleyJointExample extends Forge2DGame with TapDetector, HasDraggables {
firstBox.loaded,
secondBox.loaded,
firstPulley.loaded,
secondPulley.loaded
secondPulley.loaded,
]);
createJoint(firstBox, secondBox);

View File

@ -60,7 +60,7 @@ class BoundedPositionBehavior extends Component {
);
_target = parent! as PositionProvider;
}
if (isValidPoint(target.position)) {
if (_target != null && isValidPoint(target.position)) {
_previousPosition.setFrom(target.position);
} else {
_previousPosition.setFrom(_bounds.center);

View File

@ -175,7 +175,7 @@ class SpriteAnimation {
return SpriteAnimation(
[
for (var i = 0; i < sprites.length; i++)
SpriteAnimationFrame(sprites[i], stepTimes[i])
SpriteAnimationFrame(sprites[i], stepTimes[i]),
],
loop: loop,
);
@ -199,7 +199,7 @@ class SpriteAnimation {
srcPosition: frameData.srcPosition,
),
frameData.stepTime,
)
),
],
loop: data.loop,
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -70,7 +70,7 @@ void main() {
position: Vector2(i * 60.0 - i * i.abs() * 3, 0),
radius: 25 - i.abs() * 3,
anchor: Anchor.center,
)
),
]);
game.addAll([world, camera]);
},

View File

@ -70,7 +70,7 @@ void main() {
'${1000 / (totalTime / ticks)} runs per second\n'
'${_TestBlock.collisionCounter}',
);
}
},
});
});
}

View File

@ -1723,7 +1723,7 @@ void main() {
final reflectionRay2 = results[1].reflectionRay;
expect(reflectionRay2?.origin, Vector2(50, 0));
expect(reflectionRay2?.direction, Vector2(1, 1)..normalize());
}
},
});
});
}

View File

@ -38,7 +38,7 @@ void main() {
expect(hitboxParent.startCounter, 1);
expect(hitboxParent.endCounter, 1);
expect(hitboxParent.onCollisionCounter, 1);
}
},
});
});
}

View File

@ -300,7 +300,7 @@ void main() {
expect(blockB.activeCollisions, {blockA, innerBlockA});
expect(innerBlockA.activeCollisions, {blockB, innerBlockB});
expect(innerBlockB.activeCollisions, {blockA, innerBlockA});
}
},
});
});
}

View File

@ -1046,7 +1046,7 @@ void main() {
}
matchComponentsAtPoint(Vector2(0, 0), [
_Pair(game, [Vector2(0, 0)])
_Pair(game, [Vector2(0, 0)]),
]);
matchComponentsAtPoint(Vector2(400, 100), [
_Pair(compA, [Vector2(400, 100), Vector2(25, 25)]),

View File

@ -798,7 +798,7 @@ void main() {
Vector2(0, 1),
Vector2.all(2),
Vector2(-1, 0),
Vector2.all(-50)
Vector2.all(-50),
];
final expectedAngles = [pi, (3 * pi / 4), (-pi / 2), (-pi / 4)];
@ -824,7 +824,7 @@ void main() {
Vector2(0, 1),
Vector2.all(2),
Vector2(-1, 0),
Vector2.all(-50)
Vector2.all(-50),
];
final expectedAngles = [pi / 2, (pi / 4), -pi, (-3 * pi / 4)];
@ -854,9 +854,9 @@ void main() {
children: [
component = PositionComponent(
nativeAngle: -pi,
)
),
],
)
),
],
);
@ -864,7 +864,7 @@ void main() {
Vector2(0, 1),
Vector2.all(2),
Vector2(-1, 0),
Vector2.all(-50)
Vector2.all(-50),
];
final expectedAngles = [pi, (3 * pi / 4), -pi / 2, (-pi / 4)];

View File

@ -19,13 +19,13 @@ void main() {
Vector2(0, 0),
Vector2(0, 20),
Vector2(10, 20),
Vector2(10, 0)
Vector2(10, 0),
];
final size2 = [
Vector2(0, 0),
Vector2(0, 40),
Vector2(20, 40),
Vector2(20, 0)
Vector2(20, 0),
];
component.size /= 2;
@ -47,13 +47,13 @@ void main() {
Vector2(0, 0),
Vector2(0, 15),
Vector2(15, 15),
Vector2(15, 0)
Vector2(15, 0),
];
final size2 = [
Vector2(0, 0),
Vector2(0, 30),
Vector2(30, 30),
Vector2(30, 0)
Vector2(30, 0),
];
component.size /= 2;
@ -74,13 +74,13 @@ void main() {
Vector2(0, 0),
Vector2(0, 30),
Vector2(25, 30),
Vector2(25, 0)
Vector2(25, 0),
];
final size2 = [
Vector2(0, 0),
Vector2(0, 60),
Vector2(50, 60),
Vector2(50, 0)
Vector2(50, 0),
];
component.size /= 2;
@ -102,13 +102,13 @@ void main() {
Vector2(0, 0),
Vector2(0, 15),
Vector2(45, 15),
Vector2(45, 0)
Vector2(45, 0),
];
final size2 = [
Vector2(0, 0),
Vector2(0, 30),
Vector2(90, 30),
Vector2(90, 0)
Vector2(90, 0),
];
component.size /= 2;

View File

@ -237,7 +237,7 @@ Future<void> main() async {
final component = SpriteAnimationGroupComponent<_AnimationState>(
animations: {
_AnimationState.idle: animation1,
_AnimationState.running: animation2
_AnimationState.running: animation2,
},
current: _AnimationState.idle,
);
@ -264,7 +264,7 @@ Future<void> main() async {
final component = SpriteAnimationGroupComponent<_AnimationState>(
animations: {
_AnimationState.idle: animation1,
_AnimationState.running: animation2
_AnimationState.running: animation2,
},
current: _AnimationState.idle,
)..autoResize = false;

View File

@ -22,7 +22,7 @@ void main() {
onDragStart: (e) => nDragStartCalled++,
onDragUpdate: (e) => nDragUpdateCalled++,
onDragEnd: (e) => nDragEndCalled++,
)
),
],
);
await tester.pumpWidget(GameWidget(game: game));

View File

@ -24,7 +24,7 @@ void main() {
onLongTapDown: (e) => nLongTapDown++,
onTapCancel: (e) => nTapCancel++,
onTapUp: (e) => nTapUp++,
)
),
],
);
await tester.pumpWidget(GameWidget(game: game));
@ -93,7 +93,7 @@ void main() {
},
onTapCancel: (e) => nTapCancelChild++,
onTapUp: (e) => nTapUpChild++,
)
),
],
),
],
@ -248,7 +248,7 @@ void main() {
nTappableCancelled++;
return true;
},
)
),
],
);
await tester.pumpWidget(GameWidget(game: game));

View File

@ -291,7 +291,7 @@ void main() {
autofocus: true,
child: const SizedBox.shrink(),
);
}
},
},
),
);
@ -323,7 +323,7 @@ void main() {
focusNode: overlayFocusNode,
child: const SizedBox.shrink(),
);
}
},
},
),
);
@ -368,7 +368,7 @@ void main() {
autofocus: true,
child: const SizedBox.shrink(),
);
}
},
},
),
);
@ -463,7 +463,7 @@ void main() {
autofocus: true,
child: const SizedBox.shrink(),
);
}
},
},
),
);

View File

@ -232,7 +232,7 @@ void main() {
glyphs: [
for (var j = 0; j < lines.length; j++)
for (var i = 0; i < lines[j].length; i++)
Glyph(lines[j][i], left: i * 6, top: 1 + j * 6)
Glyph(lines[j][i], left: i * 6, top: 1 + j * 6),
],
);
const colors = [
@ -303,7 +303,7 @@ Future<SpriteFontRenderer> createRenderer({
glyphs: [
for (var j = 0; j < lines.length; j++)
for (var i = 0; i < lines[j].length; i++)
Glyph(lines[j][i], left: i * 6, top: 1 + j * 6)
Glyph(lines[j][i], left: i * 6, top: 1 + j * 6),
],
),
scale: scale,

View File

@ -33,7 +33,7 @@ class Forge2DExample extends Forge2DGame {
Wall(topLeft, topRight),
Wall(topRight, bottomRight),
Wall(bottomLeft, bottomRight),
Wall(topLeft, bottomLeft)
Wall(topLeft, bottomLeft),
];
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -194,7 +194,7 @@ class DialogueRunner {
await _combineFutures([
command.execute(this),
if (command is UserDefinedCommand)
for (final view in _dialogueViews) view.onCommand(command)
for (final view in _dialogueViews) view.onCommand(command),
]);
}

View File

@ -51,6 +51,7 @@ linter:
- cancel_subscriptions
- cast_nullable_to_non_nullable
- close_sinks
- collection_methods_unrelated_type
- comment_references
- constant_identifier_names
- control_flow_in_finally
@ -68,13 +69,11 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- join_return_with_assignment
- library_names
- library_prefixes
- library_private_types_in_public_api
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -71,7 +71,7 @@ void main() {
size: const Size(300, 300),
painter: SvgPainter(flameSvg),
),
)
),
],
),
),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 1006 B

View File

@ -129,7 +129,7 @@ class TiledAtlas {
// parallelize the download of images.
await Future.wait([
...imageList.map((tiledImage) => Flame.images.load(tiledImage.source!))
...imageList.map((tiledImage) => Flame.images.load(tiledImage.source!)),
]);
final emptyPaint = Paint();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -160,7 +160,7 @@ void main() {
TiledComponent.load(
'single_tile_map_2.tmx',
Vector2(16, 16),
)
),
]);
final atlas = TiledAtlas.atlasMap.values.first;

View File

@ -118,7 +118,7 @@ void main() {
imageNames: ['map-level1.png', 'image1.png'],
stringNames: [
'map.tmx',
'tiles_custom_path/external_tileset_custom_path.tsx'
'tiles_custom_path/external_tileset_custom_path.tsx',
],
);
@ -792,7 +792,7 @@ void main() {
'orthogonal',
'isometric',
'hexagonal',
'staggered'
'staggered',
]) {
group(mapType, () {
setUp(() async {
@ -918,7 +918,7 @@ void main() {
'orthogonal',
'isometric',
'hexagonal',
'staggered'
'staggered',
]) {
group(mapType, () {
setUp(() async {