chore: character animations files (#223)

* chore: add animation files

* chore: update CharacterTheme with animation path

* fix: apply code review

* fix: update description

* fix: test
pull/228/head
arturplaczek 2 years ago committed by GitHub
parent 169fb2c2d5
commit 08bc805b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,7 +36,7 @@ extension LeaderboardEntryDataX on LeaderboardEntryData {
rank: position.toString(),
playerInitials: playerInitials,
score: score,
character: character.toTheme.character,
character: character.toTheme.leaderboardIcon,
);
}
}

@ -124,7 +124,7 @@ class CharacterImageButton extends StatelessWidget {
),
child: Padding(
padding: const EdgeInsets.all(8),
child: characterTheme.character.image(),
child: characterTheme.icon.image(),
),
),
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

@ -28,6 +28,10 @@ class $AssetsImagesGen {
class $AssetsImagesAndroidGen {
const $AssetsImagesAndroidGen();
/// File path: assets/images/android/animation.png
AssetGenImage get animation =>
const AssetGenImage('assets/images/android/animation.png');
/// File path: assets/images/android/background.png
AssetGenImage get background =>
const AssetGenImage('assets/images/android/background.png');
@ -48,6 +52,10 @@ class $AssetsImagesAndroidGen {
class $AssetsImagesDashGen {
const $AssetsImagesDashGen();
/// File path: assets/images/dash/animation.png
AssetGenImage get animation =>
const AssetGenImage('assets/images/dash/animation.png');
/// File path: assets/images/dash/background.png
AssetGenImage get background =>
const AssetGenImage('assets/images/dash/background.png');
@ -67,6 +75,10 @@ class $AssetsImagesDashGen {
class $AssetsImagesDinoGen {
const $AssetsImagesDinoGen();
/// File path: assets/images/dino/animation.png
AssetGenImage get animation =>
const AssetGenImage('assets/images/dino/animation.png');
/// File path: assets/images/dino/background.png
AssetGenImage get background =>
const AssetGenImage('assets/images/dino/background.png');
@ -86,6 +98,10 @@ class $AssetsImagesDinoGen {
class $AssetsImagesSparkyGen {
const $AssetsImagesSparkyGen();
/// File path: assets/images/sparky/animation.png
AssetGenImage get animation =>
const AssetGenImage('assets/images/sparky/animation.png');
/// File path: assets/images/sparky/background.png
AssetGenImage get background =>
const AssetGenImage('assets/images/sparky/background.png');

@ -14,9 +14,6 @@ class AndroidTheme extends CharacterTheme {
@override
Color get ballColor => Colors.green;
@override
AssetGenImage get character => Assets.images.android.character;
@override
AssetGenImage get background => Assets.images.android.background;
@ -25,4 +22,7 @@ class AndroidTheme extends CharacterTheme {
@override
AssetGenImage get leaderboardIcon => Assets.images.android.leaderboardIcon;
@override
AssetGenImage get animation => Assets.images.android.animation;
}

@ -18,9 +18,6 @@ abstract class CharacterTheme extends Equatable {
/// Ball color for this theme.
Color get ballColor;
/// Asset for the theme character.
AssetGenImage get character;
/// Asset for the background.
AssetGenImage get background;
@ -30,13 +27,16 @@ abstract class CharacterTheme extends Equatable {
/// Icon asset for the leaderboard.
AssetGenImage get leaderboardIcon;
/// Asset for the the idle character animation.
AssetGenImage get animation;
@override
List<Object?> get props => [
name,
ballColor,
character,
background,
icon,
leaderboardIcon,
animation,
];
}

@ -14,9 +14,6 @@ class DashTheme extends CharacterTheme {
@override
Color get ballColor => Colors.blue;
@override
AssetGenImage get character => Assets.images.dash.character;
@override
AssetGenImage get background => Assets.images.dash.background;
@ -25,4 +22,7 @@ class DashTheme extends CharacterTheme {
@override
AssetGenImage get leaderboardIcon => Assets.images.dash.leaderboardIcon;
@override
AssetGenImage get animation => Assets.images.dash.animation;
}

@ -14,9 +14,6 @@ class DinoTheme extends CharacterTheme {
@override
Color get ballColor => Colors.grey;
@override
AssetGenImage get character => Assets.images.dino.character;
@override
AssetGenImage get background => Assets.images.dino.background;
@ -25,4 +22,7 @@ class DinoTheme extends CharacterTheme {
@override
AssetGenImage get leaderboardIcon => Assets.images.dino.leaderboardIcon;
@override
AssetGenImage get animation => Assets.images.dino.animation;
}

@ -14,9 +14,6 @@ class SparkyTheme extends CharacterTheme {
@override
String get name => 'Sparky';
@override
AssetGenImage get character => Assets.images.sparky.character;
@override
AssetGenImage get background => Assets.images.sparky.background;
@ -25,4 +22,7 @@ class SparkyTheme extends CharacterTheme {
@override
AssetGenImage get leaderboardIcon => Assets.images.sparky.leaderboardIcon;
@override
AssetGenImage get animation => Assets.images.sparky.animation;
}

@ -30,7 +30,7 @@ void main() {
rank: '1',
playerInitials: 'ABC',
score: 1500,
character: DashTheme().character,
character: DashTheme().leaderboardIcon,
);
test(

@ -121,7 +121,7 @@ void main() {
rank: '1',
playerInitials: 'ABC',
score: 10000,
character: DashTheme().character,
character: DashTheme().leaderboardIcon,
),
],
),

Loading…
Cancel
Save