diff --git a/examples/games/padracing/lib/lap_line.dart b/examples/games/padracing/lib/lap_line.dart index 8e4758d6a6c..2afc1e984ed 100644 --- a/examples/games/padracing/lib/lap_line.dart +++ b/examples/games/padracing/lib/lap_line.dart @@ -57,7 +57,7 @@ class LapLine extends BodyComponent with ContactCallbacks { late final Rect _scaledRect = (size * 10).toRect(); late final Rect _drawRect = size.toRect(); - Future createFinishOverlay() async { + Future createFinishOverlay() { final recorder = PictureRecorder(); final canvas = Canvas(recorder, _scaledRect); final step = _scaledRect.width / 2; diff --git a/examples/games/rogue_shooter/lib/main.dart b/examples/games/rogue_shooter/lib/main.dart index 1791cb96a03..24ee2a7b070 100644 --- a/examples/games/rogue_shooter/lib/main.dart +++ b/examples/games/rogue_shooter/lib/main.dart @@ -2,6 +2,6 @@ import 'package:flame/game.dart'; import 'package:flutter/widgets.dart'; import 'package:rogue_shooter/rogue_shooter_game.dart'; -void main() async { +void main() { runApp(GameWidget(game: RogueShooterGame())); } diff --git a/packages/flame/lib/src/components/parallax_component.dart b/packages/flame/lib/src/components/parallax_component.dart index 8c1433d73ba..bf0979405c6 100644 --- a/packages/flame/lib/src/components/parallax_component.dart +++ b/packages/flame/lib/src/components/parallax_component.dart @@ -26,7 +26,7 @@ extension ParallaxComponentExtension on FlameGame { int? priority, FilterQuality? filterQuality, ComponentKey? key, - }) async { + }) { return ParallaxComponent.load( dataList, baseVelocity: baseVelocity, diff --git a/packages/flame/lib/src/image_composition.dart b/packages/flame/lib/src/image_composition.dart index 5c3996967d8..ff86f02e538 100644 --- a/packages/flame/lib/src/image_composition.dart +++ b/packages/flame/lib/src/image_composition.dart @@ -83,7 +83,7 @@ class ImageComposition { void clear() => _composes.clear(); /// Compose all the images into a single composition. - Future compose() async { + Future compose() { final result = _composeCore(); return result.picture.toImageSafe( diff --git a/packages/flame/lib/src/sprite.dart b/packages/flame/lib/src/sprite.dart index 20fa24a4116..7b17da0d0a5 100644 --- a/packages/flame/lib/src/sprite.dart +++ b/packages/flame/lib/src/sprite.dart @@ -126,7 +126,7 @@ class Sprite { /// **Note:** This is a heavy async operation and should not be called inside /// the game loop. Remember to call dispose on the [Image] object once you /// aren't going to use it anymore. - Future toImage() async { + Future toImage() { final composition = ImageComposition() ..add(image, _zeroPosition, source: src); return composition.compose(); diff --git a/packages/flame/test/cache/assets_cache_test.dart b/packages/flame/test/cache/assets_cache_test.dart index 9b5970df529..b6305b22a2b 100644 --- a/packages/flame/test/cache/assets_cache_test.dart +++ b/packages/flame/test/cache/assets_cache_test.dart @@ -20,8 +20,7 @@ void main() { expect(file, isA()); expect( - () async => - assetsCache.readBinaryFile(fixture('test_text_file.txt').path), + () => assetsCache.readBinaryFile(fixture('test_text_file.txt').path), failsAssert('"$fileName" was previously loaded as a text file'), ); }); @@ -39,7 +38,7 @@ void main() { expect(file, isA()); expect( - () async => assetsCache.readFile(fixture('cave_ace.fa').path), + () => assetsCache.readFile(fixture('cave_ace.fa').path), failsAssert('"$fileName" was previously loaded as a binary file'), ); }); diff --git a/packages/flame/test/cache/memory_cache_test.dart b/packages/flame/test/cache/memory_cache_test.dart index 3068a4991ee..622c1ce4f8e 100644 --- a/packages/flame/test/cache/memory_cache_test.dart +++ b/packages/flame/test/cache/memory_cache_test.dart @@ -29,7 +29,7 @@ void main() { expect(cache.size, 1); }); - test('clear', () async { + test('clear', () { final cache = MemoryCache(); cache.setValue(0, 'bla'); expect(cache.containsKey(0), true); @@ -39,7 +39,7 @@ void main() { expect(cache.size, 0); }); - test('clearCache', () async { + test('clearCache', () { final cache = MemoryCache(); cache.setValue(0, 'bla'); cache.setValue(1, 'ble'); diff --git a/packages/flame/test/components/text_box_component_test.dart b/packages/flame/test/components/text_box_component_test.dart index 27c26db9516..d84b6cb2097 100644 --- a/packages/flame/test/components/text_box_component_test.dart +++ b/packages/flame/test/components/text_box_component_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('TextBoxComponent', () { - test('size is properly computed', () async { + test('size is properly computed', () { final c = TextBoxComponent( text: 'The quick brown fox jumps over the lazy dog.', boxConfig: TextBoxConfig( @@ -20,7 +20,7 @@ void main() { expect(c.size.y, greaterThan(1)); }); - test('size is properly computed with new line character', () async { + test('size is properly computed with new line character', () { final c = TextBoxComponent( text: 'The quick brown fox \n jumps over the lazy dog.', boxConfig: TextBoxConfig( @@ -32,7 +32,7 @@ void main() { expect(c.size.y, 256); }); - test('lines are properly computed with new line character', () async { + test('lines are properly computed with new line character', () { final c = TextBoxComponent( text: 'The quick brown fox \n jumps over the lazy dog.', boxConfig: TextBoxConfig( diff --git a/packages/flame/test/game/mixins/single_game_instance_test.dart b/packages/flame/test/game/mixins/single_game_instance_test.dart index 67d0dfd2cc2..1f52bfd2736 100644 --- a/packages/flame/test/game/mixins/single_game_instance_test.dart +++ b/packages/flame/test/game/mixins/single_game_instance_test.dart @@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('SingleGameInstance', () { - test('game instance becomes statically available', () async { + test('game instance becomes statically available', () { final game = SingletonGame() ..onGameResize(Vector2.all(100)) ..onMount(); @@ -13,7 +13,7 @@ void main() { game.onRemove(); }); - test('guard against multiple game instances', () async { + test('guard against multiple game instances', () { final game = SingletonGame() ..onGameResize(Vector2.all(100)) ..onMount(); diff --git a/packages/flame/test/particles/curved_particle_test.dart b/packages/flame/test/particles/curved_particle_test.dart index 0a02e5c294b..87b1e8bf1f6 100644 --- a/packages/flame/test/particles/curved_particle_test.dart +++ b/packages/flame/test/particles/curved_particle_test.dart @@ -6,13 +6,13 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('CurvedParticle', () { - test('A Particle which applies certain Curve', () async { + test('A Particle which applies certain Curve', () { final particle = CurvedParticle(); expect(particle.curve, Curves.linear); }); - test('A Particle which applies certain Curve', () async { + test('A Particle which applies certain Curve', () { final particle = CurvedParticle(curve: Curves.decelerate); expect(particle.curve, Curves.decelerate); diff --git a/packages/flame/test/sprite_animation_ticker_test.dart b/packages/flame/test/sprite_animation_ticker_test.dart index e12c798547a..a02d03bb88b 100644 --- a/packages/flame/test/sprite_animation_ticker_test.dart +++ b/packages/flame/test/sprite_animation_ticker_test.dart @@ -101,8 +101,7 @@ void main() { animationTicker.update(1); }); - test('completed completes when the animation has already completed', - () async { + test('completed completes when the animation has already completed', () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList( [sprite], @@ -115,7 +114,7 @@ void main() { }); test("completed doesn't complete when the animation is yet to complete", - () async { + () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList( [sprite], @@ -126,7 +125,7 @@ void main() { expectLater(animationTicker.completed, doesNotComplete); }); - test("completed doesn't complete when animation is looping", () async { + test("completed doesn't complete when animation is looping", () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList([sprite], stepTime: 1).createTicker(); @@ -136,7 +135,7 @@ void main() { test( "completed doesn't complete when animation is looping and on last frame", - () async { + () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList([sprite], stepTime: 1).createTicker(); @@ -146,7 +145,7 @@ void main() { }, ); - test("completed doesn't complete after the animation is reset", () async { + test("completed doesn't complete after the animation is reset", () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList( [sprite], @@ -163,7 +162,7 @@ void main() { expect(animationTicker.completeCompleter!.isCompleted, false); }); - test('paused pauses ticket', () async { + test('paused pauses ticket', () { final sprite = MockSprite(); final animationTicker = SpriteAnimation.spriteList( [sprite, sprite], diff --git a/packages/flame/test/spritesheet_test.dart b/packages/flame/test/spritesheet_test.dart index fa9e3424d17..79ff8b3f2f6 100644 --- a/packages/flame/test/spritesheet_test.dart +++ b/packages/flame/test/spritesheet_test.dart @@ -13,7 +13,7 @@ void main() { when(() => image.width).thenReturn(100); when(() => image.height).thenReturn(100); - test('calculates all field from SpriteSheet', () async { + test('calculates all field from SpriteSheet', () { final spriteSheet = SpriteSheet( image: image, srcSize: Vector2(1, 2), diff --git a/packages/flame_audio/lib/flame_audio.dart b/packages/flame_audio/lib/flame_audio.dart index f639c84fefd..83b835024d8 100644 --- a/packages/flame_audio/lib/flame_audio.dart +++ b/packages/flame_audio/lib/flame_audio.dart @@ -62,7 +62,7 @@ class FlameAudio { } /// Plays a single run of the given [file], with a given [volume]. - static Future play(String file, {double volume = 1.0}) async { + static Future play(String file, {double volume = 1.0}) { return _preparePlayer( file, volume, @@ -72,7 +72,7 @@ class FlameAudio { } /// Plays, and keeps looping the given [file]. - static Future loop(String file, {double volume = 1.0}) async { + static Future loop(String file, {double volume = 1.0}) { return _preparePlayer( file, volume, diff --git a/packages/flame_fire_atlas/lib/flame_fire_atlas.dart b/packages/flame_fire_atlas/lib/flame_fire_atlas.dart index 8dcefee734e..a0a9edb5760 100644 --- a/packages/flame_fire_atlas/lib/flame_fire_atlas.dart +++ b/packages/flame_fire_atlas/lib/flame_fire_atlas.dart @@ -12,7 +12,7 @@ import 'package:flame/sprite.dart'; /// Adds FireAtlas loading methods to Flame [Game]. extension FireAtlasExtensions on Game { /// Load a [FireAtlas] instances from the given [asset] - Future loadFireAtlas(String asset) async { + Future loadFireAtlas(String asset) { return FireAtlas.loadAsset( asset, assets: assets, diff --git a/packages/flame_jenny/jenny/test/dialogue_runner_test.dart b/packages/flame_jenny/jenny/test/dialogue_runner_test.dart index fcb5ff7a967..8228321f1a4 100644 --- a/packages/flame_jenny/jenny/test/dialogue_runner_test.dart +++ b/packages/flame_jenny/jenny/test/dialogue_runner_test.dart @@ -318,7 +318,7 @@ void main() { commands: ['this'], ); - test('Dialogue runs node before finishing the previous one', () async { + test('Dialogue runs node before finishing the previous one', () { final yarn = YarnProject() ..parse( dedent(''' diff --git a/packages/flame_jenny/jenny/test/structure/commands/jump_command_test.dart b/packages/flame_jenny/jenny/test/structure/commands/jump_command_test.dart index b746456ebb7..e1fd1842a31 100644 --- a/packages/flame_jenny/jenny/test/structure/commands/jump_command_test.dart +++ b/packages/flame_jenny/jenny/test/structure/commands/jump_command_test.dart @@ -105,7 +105,7 @@ void main() { ); }); - test('<> with unknown destination', () async { + test('<> with unknown destination', () { final yarn = YarnProject() ..parse( 'title:A\n' diff --git a/packages/flame_jenny/jenny/test/structure/commands/visit_command_test.dart b/packages/flame_jenny/jenny/test/structure/commands/visit_command_test.dart index 15599dc6e33..b37d8ed081d 100644 --- a/packages/flame_jenny/jenny/test/structure/commands/visit_command_test.dart +++ b/packages/flame_jenny/jenny/test/structure/commands/visit_command_test.dart @@ -204,7 +204,7 @@ void main() { ); }); - test('<> with unknown destination', () async { + test('<> with unknown destination', () { final yarn = YarnProject() ..parse( 'title: A\n' diff --git a/packages/flame_jenny/jenny/test/structure/expressions/functions/dice_test.dart b/packages/flame_jenny/jenny/test/structure/expressions/functions/dice_test.dart index c3b2eb0415a..95afd6c3f12 100644 --- a/packages/flame_jenny/jenny/test/structure/expressions/functions/dice_test.dart +++ b/packages/flame_jenny/jenny/test/structure/expressions/functions/dice_test.dart @@ -42,7 +42,7 @@ void main() { expect(diceFn.value, 3); }); - test('dice(0)', () async { + test('dice(0)', () { final diceFn = DiceFn(const NumLiteral(0), YarnProject()); expect( () => diceFn.value, diff --git a/packages/flame_jenny/jenny/test/structure/expressions/functions/random_range_test.dart b/packages/flame_jenny/jenny/test/structure/expressions/functions/random_range_test.dart index 634d38b94d2..0ae3061feaa 100644 --- a/packages/flame_jenny/jenny/test/structure/expressions/functions/random_range_test.dart +++ b/packages/flame_jenny/jenny/test/structure/expressions/functions/random_range_test.dart @@ -52,7 +52,7 @@ void main() { expect(max, 20); }); - test('random range with min == max', () async { + test('random range with min == max', () { final fn = RandomRangeFn( const NumLiteral(0), const NumLiteral(0), @@ -61,7 +61,7 @@ void main() { expect(fn.value, 0); }); - test('random range with min > max', () async { + test('random range with min > max', () { final fn = RandomRangeFn( const NumLiteral(10), const NumLiteral(0), diff --git a/packages/flame_lottie/example/lib/main.dart b/packages/flame_lottie/example/lib/main.dart index 3ac40017006..fdd565876b8 100644 --- a/packages/flame_lottie/example/lib/main.dart +++ b/packages/flame_lottie/example/lib/main.dart @@ -2,7 +2,7 @@ import 'package:flame/game.dart'; import 'package:flame_lottie/flame_lottie.dart'; import 'package:flutter/material.dart'; -void main() async { +void main() { runApp(GameWidget(game: LottieExampleGame())); } diff --git a/packages/flame_rive/test/flame_rive_test.dart b/packages/flame_rive/test/flame_rive_test.dart index 5c85fa424eb..2ddf2b28f90 100644 --- a/packages/flame_rive/test/flame_rive_test.dart +++ b/packages/flame_rive/test/flame_rive_test.dart @@ -33,7 +33,7 @@ void main() { expect(artboard.name, artboardName); }); - test('Load an artboard that does not exist', () async { + test('Load an artboard that does not exist', () { expect( () => loadArtboard( riveFile, diff --git a/packages/flame_test/lib/src/test_flame_game.dart b/packages/flame_test/lib/src/test_flame_game.dart index 3bad0505b86..3040f4f0e8e 100644 --- a/packages/flame_test/lib/src/test_flame_game.dart +++ b/packages/flame_test/lib/src/test_flame_game.dart @@ -72,7 +72,7 @@ Future initializeGame(CreateFunction create) async { return game; } -Future initializeFlameGame() async => initializeGame(FlameGame.new); +Future initializeFlameGame() => initializeGame(FlameGame.new); typedef CreateFunction = T Function(); typedef AsyncVoidFunction = Future Function(); diff --git a/packages/flame_tiled/lib/src/renderable_tile_map.dart b/packages/flame_tiled/lib/src/renderable_tile_map.dart index 842bb5c473b..86dcb996495 100644 --- a/packages/flame_tiled/lib/src/renderable_tile_map.dart +++ b/packages/flame_tiled/lib/src/renderable_tile_map.dart @@ -315,7 +315,7 @@ class RenderableTiledMap { required TiledAtlas atlas, bool? ignoreFlip, Images? images, - }) async { + }) { final visibleLayers = layers.where((layer) => layer.visible); final layerLoaders = visibleLayers.map((layer) async { diff --git a/packages/flame_tiled/test/tile_atlas_test.dart b/packages/flame_tiled/test/tile_atlas_test.dart index c7097a84cce..97fa9147951 100644 --- a/packages/flame_tiled/test/tile_atlas_test.dart +++ b/packages/flame_tiled/test/tile_atlas_test.dart @@ -23,7 +23,7 @@ void main() { }); group('loadImages', () { - setUp(() async { + setUp(() { TiledAtlas.atlasMap.clear(); Flame.bundle = TestAssetBundle( imageNames: [ @@ -136,7 +136,7 @@ void main() { }); group('Single tileset map', () { - setUp(() async { + setUp(() { TiledAtlas.atlasMap.clear(); Flame.bundle = TestAssetBundle( imageNames: [ diff --git a/packages/flame_tiled/test/tiled_test.dart b/packages/flame_tiled/test/tiled_test.dart index 1be10402c5b..12d943ad52e 100644 --- a/packages/flame_tiled/test/tiled_test.dart +++ b/packages/flame_tiled/test/tiled_test.dart @@ -36,7 +36,7 @@ void main() { tiled = await TiledComponent.load('map.tmx', Vector2.all(16)); }); - test('correct loads the file', () async { + test('correct loads the file', () { expect(tiled.tileMap.renderableLayers.length, equals(3)); }); @@ -51,7 +51,7 @@ void main() { }); group('is positionable', () { - test('size, width, and height are readable - not writable', () async { + test('size, width, and height are readable - not writable', () { expect(tiled.size, Vector2(512.0, 2048.0)); expect(tiled.width, 512); expect(tiled.height, 2048); @@ -64,7 +64,7 @@ void main() { expect(tiled.size, Vector2(512.0, 2048.0)); }); - test('from constructor', () async { + test('from constructor', () { final map = TiledComponent( tiled.tileMap, position: Vector2(10, 20),