refactor: PR suggestions

pull/381/head
alestiago 3 years ago
parent 3eb44b6658
commit c2e607abe6

@ -22,7 +22,7 @@ class BonusAnimation extends StatefulWidget {
Key? key, Key? key,
VoidCallback? onCompleted, VoidCallback? onCompleted,
}) : this._( }) : this._(
Assets.images.bonusAnimation.DashBumper.keyName, Assets.images.bonusAnimation.dashNest.keyName,
onCompleted: onCompleted, onCompleted: onCompleted,
key: key, key: key,
); );
@ -75,7 +75,7 @@ class BonusAnimation extends StatefulWidget {
static List<Future> loadAssets() { static List<Future> loadAssets() {
Flame.images.prefix = ''; Flame.images.prefix = '';
return [ 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.sparkyTurboCharge.keyName),
Flame.images.load(Assets.images.bonusAnimation.dinoChomp.keyName), Flame.images.load(Assets.images.bonusAnimation.dinoChomp.keyName),
Flame.images.load(Assets.images.bonusAnimation.androidSpaceship.keyName), Flame.images.load(Assets.images.bonusAnimation.androidSpaceship.keyName),

@ -26,7 +26,7 @@ class $AssetsImagesBonusAnimationGen {
'assets/images/bonus_animation/android_spaceship.png'); 'assets/images/bonus_animation/android_spaceship.png');
/// File path: assets/images/bonus_animation/dash_nest.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'); const AssetGenImage('assets/images/bonus_animation/dash_nest.png');
/// File path: assets/images/bonus_animation/dino_chomp.png /// File path: assets/images/bonus_animation/dino_chomp.png

@ -40,6 +40,8 @@ class DashBumper extends BodyComponent with InitialPosition {
); );
/// {@macro dash_bumper} /// {@macro dash_bumper}
///
/// [DashBumper.main] displays a Dash on top of it.
DashBumper.main({ DashBumper.main({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
@ -56,6 +58,9 @@ class DashBumper extends BodyComponent with InitialPosition {
); );
/// {@macro dash_bumper} /// {@macro dash_bumper}
///
/// [DashBumper.b] is positioned at the right side of the [DashBumper.main] in
/// the flutter forest.
DashBumper.a({ DashBumper.a({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
@ -72,6 +77,9 @@ class DashBumper extends BodyComponent with InitialPosition {
); );
/// {@macro dash_bumper} /// {@macro dash_bumper}
///
/// [DashBumper.b] is positioned at the left side of the [DashBumper.main] in
/// the flutter forest.
DashBumper.b({ DashBumper.b({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : 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. /// This can be used for testing [DashBumper]'s behaviors in isolation.
@visibleForTesting @visibleForTesting

@ -1,9 +1,9 @@
import 'package:dashbook/dashbook.dart'; import 'package:dashbook/dashbook.dart';
import 'package:sandbox/common/common.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/signpost_game.dart';
import 'package:sandbox/stories/flutter_forest/small_dash_nest_bumper_a_game.dart'; import 'package:sandbox/stories/flutter_forest/small_dash_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_b_game.dart';
void addFlutterForestStories(Dashbook dashbook) { void addFlutterForestStories(Dashbook dashbook) {
dashbook.storiesOf('Flutter Forest') dashbook.storiesOf('Flutter Forest')

Loading…
Cancel
Save