From 97373edc227d7483397c948dba27c7459809f04a Mon Sep 17 00:00:00 2001 From: arturplaczek Date: Tue, 12 Apr 2022 17:19:12 +0200 Subject: [PATCH] chore: update characters theme --- .../lib/src/themes/android_theme.dart | 12 +++++++++++ .../lib/src/themes/character_theme.dart | 21 ++++++++++++++++++- .../lib/src/themes/dash_theme.dart | 12 +++++++++++ .../lib/src/themes/dino_theme.dart | 12 +++++++++++ .../lib/src/themes/sparky_theme.dart | 12 +++++++++++ .../test/src/themes/android_theme_test.dart | 18 ++++++++++++++++ .../test/src/themes/dash_theme_test.dart | 18 ++++++++++++++++ .../test/src/themes/dino_theme_test.dart | 18 ++++++++++++++++ .../test/src/themes/sparky_theme_test.dart | 18 ++++++++++++++++ 9 files changed, 140 insertions(+), 1 deletion(-) diff --git a/packages/pinball_theme/lib/src/themes/android_theme.dart b/packages/pinball_theme/lib/src/themes/android_theme.dart index f6605f52..08c753fe 100644 --- a/packages/pinball_theme/lib/src/themes/android_theme.dart +++ b/packages/pinball_theme/lib/src/themes/android_theme.dart @@ -8,9 +8,21 @@ class AndroidTheme extends CharacterTheme { /// {@macro android_theme} const AndroidTheme(); + @override + String get name => 'Android'; + @override Color get ballColor => Colors.green; @override AssetGenImage get characterAsset => Assets.images.android; + + @override + AssetGenImage get backgroundAsset => Assets.images.androidBackground; + + @override + AssetGenImage get placeholderAsset => Assets.images.androidPlaceholder; + + @override + AssetGenImage get iconAsset => Assets.images.androidIcon; } diff --git a/packages/pinball_theme/lib/src/themes/character_theme.dart b/packages/pinball_theme/lib/src/themes/character_theme.dart index 9478f954..141a818e 100644 --- a/packages/pinball_theme/lib/src/themes/character_theme.dart +++ b/packages/pinball_theme/lib/src/themes/character_theme.dart @@ -12,12 +12,31 @@ abstract class CharacterTheme extends Equatable { /// {@macro character_theme} const CharacterTheme(); + /// Name of character. + String get name; + /// Ball color for this theme. Color get ballColor; /// Asset for the theme character. AssetGenImage get characterAsset; + /// Asset for the background. + AssetGenImage get backgroundAsset; + + /// Asset for the placeholder. + AssetGenImage get placeholderAsset; + + /// Icon asset. + AssetGenImage get iconAsset; + @override - List get props => [ballColor]; + List get props => [ + name, + ballColor, + characterAsset, + backgroundAsset, + placeholderAsset, + iconAsset, + ]; } diff --git a/packages/pinball_theme/lib/src/themes/dash_theme.dart b/packages/pinball_theme/lib/src/themes/dash_theme.dart index 1b5b357e..bc6a7f1a 100644 --- a/packages/pinball_theme/lib/src/themes/dash_theme.dart +++ b/packages/pinball_theme/lib/src/themes/dash_theme.dart @@ -8,9 +8,21 @@ class DashTheme extends CharacterTheme { /// {@macro dash_theme} const DashTheme(); + @override + String get name => 'Dash'; + @override Color get ballColor => Colors.blue; @override AssetGenImage get characterAsset => Assets.images.dash; + + @override + AssetGenImage get backgroundAsset => Assets.images.dashBackground; + + @override + AssetGenImage get placeholderAsset => Assets.images.dashPlaceholder; + + @override + AssetGenImage get iconAsset => Assets.images.dashIcon; } diff --git a/packages/pinball_theme/lib/src/themes/dino_theme.dart b/packages/pinball_theme/lib/src/themes/dino_theme.dart index 564cbea0..7d350d9a 100644 --- a/packages/pinball_theme/lib/src/themes/dino_theme.dart +++ b/packages/pinball_theme/lib/src/themes/dino_theme.dart @@ -8,9 +8,21 @@ class DinoTheme extends CharacterTheme { /// {@macro dino_theme} const DinoTheme(); + @override + String get name => 'Dino'; + @override Color get ballColor => Colors.grey; @override AssetGenImage get characterAsset => Assets.images.dino; + + @override + AssetGenImage get backgroundAsset => Assets.images.dinoBackground; + + @override + AssetGenImage get placeholderAsset => Assets.images.dinoPlaceholder; + + @override + AssetGenImage get iconAsset => Assets.images.dinoIcon; } diff --git a/packages/pinball_theme/lib/src/themes/sparky_theme.dart b/packages/pinball_theme/lib/src/themes/sparky_theme.dart index b4181a8c..297bdbf4 100644 --- a/packages/pinball_theme/lib/src/themes/sparky_theme.dart +++ b/packages/pinball_theme/lib/src/themes/sparky_theme.dart @@ -11,6 +11,18 @@ class SparkyTheme extends CharacterTheme { @override Color get ballColor => Colors.orange; + @override + String get name => 'Sparky'; + @override AssetGenImage get characterAsset => Assets.images.sparky; + + @override + AssetGenImage get backgroundAsset => Assets.images.sparkyBackground; + + @override + AssetGenImage get placeholderAsset => Assets.images.sparkyPlaceholder; + + @override + AssetGenImage get iconAsset => Assets.images.sparkyIcon; } diff --git a/packages/pinball_theme/test/src/themes/android_theme_test.dart b/packages/pinball_theme/test/src/themes/android_theme_test.dart index 24186c35..e46e82cd 100644 --- a/packages/pinball_theme/test/src/themes/android_theme_test.dart +++ b/packages/pinball_theme/test/src/themes/android_theme_test.dart @@ -21,5 +21,23 @@ void main() { test('characterAsset is correct', () { expect(AndroidTheme().characterAsset, equals(Assets.images.android)); }); + + test('backgroundAsset is correct', () { + expect( + AndroidTheme().backgroundAsset, + equals(Assets.images.androidBackground), + ); + }); + + test('iconAsset is correct', () { + expect(AndroidTheme().iconAsset, equals(Assets.images.androidIcon)); + }); + + test('placeholderAsset is correct', () { + expect( + AndroidTheme().placeholderAsset, + equals(Assets.images.androidPlaceholder), + ); + }); }); } diff --git a/packages/pinball_theme/test/src/themes/dash_theme_test.dart b/packages/pinball_theme/test/src/themes/dash_theme_test.dart index 2fb429e0..96770fe6 100644 --- a/packages/pinball_theme/test/src/themes/dash_theme_test.dart +++ b/packages/pinball_theme/test/src/themes/dash_theme_test.dart @@ -21,5 +21,23 @@ void main() { test('characterAsset is correct', () { expect(DashTheme().characterAsset, equals(Assets.images.dash)); }); + + test('backgroundAsset is correct', () { + expect( + DashTheme().backgroundAsset, + equals(Assets.images.dashBackground), + ); + }); + + test('iconAsset is correct', () { + expect(DashTheme().iconAsset, equals(Assets.images.dashIcon)); + }); + + test('placeholderAsset is correct', () { + expect( + DashTheme().placeholderAsset, + equals(Assets.images.dashPlaceholder), + ); + }); }); } diff --git a/packages/pinball_theme/test/src/themes/dino_theme_test.dart b/packages/pinball_theme/test/src/themes/dino_theme_test.dart index 673cccf6..9837dd69 100644 --- a/packages/pinball_theme/test/src/themes/dino_theme_test.dart +++ b/packages/pinball_theme/test/src/themes/dino_theme_test.dart @@ -21,5 +21,23 @@ void main() { test('characterAsset is correct', () { expect(DinoTheme().characterAsset, equals(Assets.images.dino)); }); + + test('backgroundAsset is correct', () { + expect( + DinoTheme().backgroundAsset, + equals(Assets.images.dinoBackground), + ); + }); + + test('iconAsset is correct', () { + expect(DinoTheme().iconAsset, equals(Assets.images.dinoIcon)); + }); + + test('placeholderAsset is correct', () { + expect( + DinoTheme().placeholderAsset, + equals(Assets.images.dinoPlaceholder), + ); + }); }); } diff --git a/packages/pinball_theme/test/src/themes/sparky_theme_test.dart b/packages/pinball_theme/test/src/themes/sparky_theme_test.dart index d0d96566..96cd673a 100644 --- a/packages/pinball_theme/test/src/themes/sparky_theme_test.dart +++ b/packages/pinball_theme/test/src/themes/sparky_theme_test.dart @@ -21,5 +21,23 @@ void main() { test('characterAsset is correct', () { expect(SparkyTheme().characterAsset, equals(Assets.images.sparky)); }); + + test('backgroundAsset is correct', () { + expect( + SparkyTheme().backgroundAsset, + equals(Assets.images.sparkyBackground), + ); + }); + + test('iconAsset is correct', () { + expect(SparkyTheme().iconAsset, equals(Assets.images.sparkyIcon)); + }); + + test('placeholderAsset is correct', () { + expect( + SparkyTheme().placeholderAsset, + equals(Assets.images.sparkyPlaceholder), + ); + }); }); }