diff --git a/assets/images/select_character/pinball_button.png b/assets/images/select_character/pinball_button.png deleted file mode 100644 index 62373b85..00000000 Binary files a/assets/images/select_character/pinball_button.png and /dev/null differ diff --git a/lib/game/view/widgets/pinball_button.dart b/lib/game/view/widgets/pinball_button.dart deleted file mode 100644 index 0f060497..00000000 --- a/lib/game/view/widgets/pinball_button.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:pinball/gen/gen.dart'; - -// TODO(arturplaczek): move PinballButton to pinball_ui - -/// {@template pinball_button} -/// Pinball button with onPressed [VoidCallback] and child [Widget]. -/// {@endtemplate} -class PinballButton extends StatelessWidget { - /// {@macro pinball_button} - const PinballButton({ - Key? key, - required Widget child, - VoidCallback? onPressed, - }) : _child = child, - _onPressed = onPressed, - super(key: key); - - final Widget _child; - final VoidCallback? _onPressed; - - @override - Widget build(BuildContext context) { - return DecoratedBox( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - Assets.images.selectCharacter.pinballButton.keyName, - ), - ), - ), - child: Center( - child: InkWell( - onTap: _onPressed, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - child: _child, - ), - ), - ), - ); - } -} diff --git a/lib/game/view/widgets/widgets.dart b/lib/game/view/widgets/widgets.dart index 2bc78c9b..5d1fccf8 100644 --- a/lib/game/view/widgets/widgets.dart +++ b/lib/game/view/widgets/widgets.dart @@ -1,6 +1,5 @@ export 'bonus_animation.dart'; export 'game_hud.dart'; -export 'pinball_button.dart'; export 'play_button_overlay.dart'; export 'round_count_display.dart'; export 'score_view.dart'; diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index dcee4781..a4ee46cc 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -70,10 +70,6 @@ class $AssetsImagesScoreGen { class $AssetsImagesSelectCharacterGen { const $AssetsImagesSelectCharacterGen(); - /// File path: assets/images/select_character/pinball_button.png - AssetGenImage get pinballButton => - const AssetGenImage('assets/images/select_character/pinball_button.png'); - /// File path: assets/images/select_character/star_a.png AssetGenImage get starA => const AssetGenImage('assets/images/select_character/star_a.png'); diff --git a/lib/select_character/widgets/selected_character.dart b/lib/select_character/widgets/selected_character.dart index 2f0cb94f..2ff3e168 100644 --- a/lib/select_character/widgets/selected_character.dart +++ b/lib/select_character/widgets/selected_character.dart @@ -3,9 +3,9 @@ import 'package:flame/sprite.dart'; import 'package:flutter/material.dart' hide Image; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pinball/select_character/select_character.dart'; -import 'package:pinball/theme/theme.dart'; import 'package:pinball_flame/pinball_flame.dart'; import 'package:pinball_theme/pinball_theme.dart'; +import 'package:pinball_ui/pinball_ui.dart'; /// {@template selected_character} /// Widget to display the selected character based on the [CharacterThemeCubit] @@ -91,8 +91,8 @@ class _SelectedCharacterState extends State children: [ Text( currentCharacter.name, - style: AppTextStyle.headline2.copyWith( - color: AppColors.white, + style: PinballTextStyle.headline2.copyWith( + color: PinballColors.white, ), textAlign: TextAlign.center, ), diff --git a/test/game/view/widgets/pinball_button_test.dart b/test/game/view/widgets/pinball_button_test.dart deleted file mode 100644 index 50566dde..00000000 --- a/test/game/view/widgets/pinball_button_test.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:pinball/game/game.dart'; - -import '../../../helpers/helpers.dart'; - -void main() { - const buttonText = 'this is the button text'; - - testWidgets('displays button', (tester) async { - await tester.pumpApp( - const Material( - child: PinballButton( - child: Text(buttonText), - ), - ), - ); - - expect(find.text(buttonText), findsOneWidget); - }); - - testWidgets('on tap calls onPressed callback', (tester) async { - var isTapped = false; - - await tester.pumpApp( - Material( - child: PinballButton( - child: const Text(buttonText), - onPressed: () { - isTapped = true; - }, - ), - ), - ); - await tester.tap(find.text(buttonText)); - - expect(isTapped, isTrue); - }); -}