From c2e607abe6188277f0b5f46083c890587dabf477 Mon Sep 17 00:00:00 2001 From: alestiago Date: Sat, 7 May 2022 18:09:23 +0100 Subject: [PATCH] refactor: PR suggestions --- lib/game/view/widgets/bonus_animation.dart | 4 ++-- lib/gen/assets.gen.dart | 2 +- .../lib/src/components/dash_bumper/dash_bumper.dart | 10 +++++++++- ...nest_bumper_game.dart => big_dash_bumper_game.dart} | 0 ...umper_a_game.dart => small_dash_bumper_a_game.dart} | 0 ...umper_b_game.dart => small_dash_bumper_b_game.dart} | 0 .../sandbox/lib/stories/flutter_forest/stories.dart | 6 +++--- 7 files changed, 15 insertions(+), 7 deletions(-) rename packages/pinball_components/sandbox/lib/stories/flutter_forest/{big_dash_nest_bumper_game.dart => big_dash_bumper_game.dart} (100%) rename packages/pinball_components/sandbox/lib/stories/flutter_forest/{small_dash_nest_bumper_a_game.dart => small_dash_bumper_a_game.dart} (100%) rename packages/pinball_components/sandbox/lib/stories/flutter_forest/{small_dash_nest_bumper_b_game.dart => small_dash_bumper_b_game.dart} (100%) diff --git a/lib/game/view/widgets/bonus_animation.dart b/lib/game/view/widgets/bonus_animation.dart index eb37b5dc..35e600f2 100644 --- a/lib/game/view/widgets/bonus_animation.dart +++ b/lib/game/view/widgets/bonus_animation.dart @@ -22,7 +22,7 @@ class BonusAnimation extends StatefulWidget { Key? key, VoidCallback? onCompleted, }) : this._( - Assets.images.bonusAnimation.DashBumper.keyName, + Assets.images.bonusAnimation.dashNest.keyName, onCompleted: onCompleted, key: key, ); @@ -75,7 +75,7 @@ class BonusAnimation extends StatefulWidget { static List loadAssets() { Flame.images.prefix = ''; return [ - Flame.images.load(Assets.images.bonusAnimation.DashBumper.keyName), + Flame.images.load(Assets.images.bonusAnimation.dashNest.keyName), Flame.images.load(Assets.images.bonusAnimation.sparkyTurboCharge.keyName), Flame.images.load(Assets.images.bonusAnimation.dinoChomp.keyName), Flame.images.load(Assets.images.bonusAnimation.androidSpaceship.keyName), diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 2a6137bd..33d2bbd1 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -26,7 +26,7 @@ class $AssetsImagesBonusAnimationGen { 'assets/images/bonus_animation/android_spaceship.png'); /// File path: assets/images/bonus_animation/dash_nest.png - AssetGenImage get DashBumper => + AssetGenImage get dashNest => const AssetGenImage('assets/images/bonus_animation/dash_nest.png'); /// File path: assets/images/bonus_animation/dino_chomp.png diff --git a/packages/pinball_components/lib/src/components/dash_bumper/dash_bumper.dart b/packages/pinball_components/lib/src/components/dash_bumper/dash_bumper.dart index 6a0de244..cf882eaa 100644 --- a/packages/pinball_components/lib/src/components/dash_bumper/dash_bumper.dart +++ b/packages/pinball_components/lib/src/components/dash_bumper/dash_bumper.dart @@ -40,6 +40,8 @@ class DashBumper extends BodyComponent with InitialPosition { ); /// {@macro dash_bumper} + /// + /// [DashBumper.main] displays a Dash on top of it. DashBumper.main({ Iterable? children, }) : this._( @@ -56,6 +58,9 @@ class DashBumper extends BodyComponent with InitialPosition { ); /// {@macro dash_bumper} + /// + /// [DashBumper.b] is positioned at the right side of the [DashBumper.main] in + /// the flutter forest. DashBumper.a({ Iterable? children, }) : this._( @@ -72,6 +77,9 @@ class DashBumper extends BodyComponent with InitialPosition { ); /// {@macro dash_bumper} + /// + /// [DashBumper.b] is positioned at the left side of the [DashBumper.main] in + /// the flutter forest. DashBumper.b({ Iterable? children, }) : this._( @@ -87,7 +95,7 @@ class DashBumper extends BodyComponent with InitialPosition { ], ); - /// Creates an [DashBumper] without any children. + /// Creates a [DashBumper] without any children. /// /// This can be used for testing [DashBumper]'s behaviors in isolation. @visibleForTesting diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/big_dash_nest_bumper_game.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/big_dash_bumper_game.dart similarity index 100% rename from packages/pinball_components/sandbox/lib/stories/flutter_forest/big_dash_nest_bumper_game.dart rename to packages/pinball_components/sandbox/lib/stories/flutter_forest/big_dash_bumper_game.dart diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_a_game.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_bumper_a_game.dart similarity index 100% rename from packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_a_game.dart rename to packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_bumper_a_game.dart diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_b_game.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_bumper_b_game.dart similarity index 100% rename from packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_b_game.dart rename to packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_bumper_b_game.dart diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart index 7c2d3518..857c3a24 100644 --- a/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart +++ b/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart @@ -1,9 +1,9 @@ import 'package:dashbook/dashbook.dart'; import 'package:sandbox/common/common.dart'; -import 'package:sandbox/stories/flutter_forest/big_dash_nest_bumper_game.dart'; +import 'package:sandbox/stories/flutter_forest/big_dash_bumper_game.dart'; import 'package:sandbox/stories/flutter_forest/signpost_game.dart'; -import 'package:sandbox/stories/flutter_forest/small_dash_nest_bumper_a_game.dart'; -import 'package:sandbox/stories/flutter_forest/small_dash_nest_bumper_b_game.dart'; +import 'package:sandbox/stories/flutter_forest/small_dash_bumper_a_game.dart'; +import 'package:sandbox/stories/flutter_forest/small_dash_bumper_b_game.dart'; void addFlutterForestStories(Dashbook dashbook) { dashbook.storiesOf('Flutter Forest')