chore: update widgets to current state from other PRs

pull/254/head
arturplaczek 3 years ago
parent 12c8492b1c
commit a0c7e8eb42

@ -21,9 +21,7 @@ class PinballButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return DecoratedBox(
onTap: _onPressed,
child: DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
@ -32,6 +30,8 @@ class PinballButton extends StatelessWidget {
), ),
), ),
child: Center( child: Center(
child: InkWell(
onTap: _onPressed,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 32, horizontal: 32,

@ -1,6 +1,5 @@
export 'bonus_animation.dart'; export 'bonus_animation.dart';
export 'game_hud.dart'; export 'game_hud.dart';
export 'pinball_button.dart'; export 'pinball_button.dart';
export 'play_button_overlay.dart';
export 'round_count_display.dart'; export 'round_count_display.dart';
export 'score_view.dart'; export 'score_view.dart';

@ -88,6 +88,7 @@ class _SelectedCharacterState extends State<SelectedCharacter>
Text( Text(
currentCharacter.name, currentCharacter.name,
style: AppTextStyle.headline3, style: AppTextStyle.headline3,
textAlign: TextAlign.center,
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
SizedBox( SizedBox(

@ -61,14 +61,14 @@ class StarAnimation extends StatelessWidget {
final double _stepTime; final double _stepTime;
/// Returns a list of assets to be loaded. /// Returns a list of assets to be loaded.
static Future<void> loadAssets() { static List<Future> loadAssets() {
Flame.images.prefix = ''; Flame.images.prefix = '';
return Flame.images.loadAll([ return [
Assets.images.selectCharacter.starA.keyName, Flame.images.load(Assets.images.selectCharacter.starA.keyName),
Assets.images.selectCharacter.starB.keyName, Flame.images.load(Assets.images.selectCharacter.starB.keyName),
Assets.images.selectCharacter.starC.keyName, Flame.images.load(Assets.images.selectCharacter.starC.keyName),
]); ];
} }
@override @override

@ -80,7 +80,7 @@ void _showPinballDialog({
builder: (_) { builder: (_) {
return Center( return Center(
child: SizedBox( child: SizedBox(
height: gameWidgetWidth, height: gameWidgetWidth * 0.87,
width: gameWidgetWidth, width: gameWidgetWidth,
child: child, child: child,
), ),

@ -20,22 +20,19 @@ class PixelatedDecoration extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const radius = BorderRadius.all(Radius.circular(12)); const radius = BorderRadius.all(Radius.circular(12));
const borderWidth = 5.0;
return DecoratedBox( return Material(
borderRadius: radius,
child: Padding(
padding: const EdgeInsets.all(5),
child: DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: radius,
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
image: AssetImage(Assets.images.dialog.background.keyName), image: AssetImage(Assets.images.dialog.background.keyName),
), ),
borderRadius: radius,
border: Border.all(
color: Colors.white,
width: borderWidth,
), ),
),
child: Padding(
padding: const EdgeInsets.all(borderWidth),
child: ClipRRect( child: ClipRRect(
borderRadius: radius, borderRadius: radius,
child: Column( child: Column(
@ -53,6 +50,7 @@ class PixelatedDecoration extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }

@ -11,7 +11,6 @@ import '../../helpers/helpers.dart';
void main() { void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
late CharacterThemeCubit characterThemeCubit; late CharacterThemeCubit characterThemeCubit;
setUpAll(() async { setUpAll(() async {

Loading…
Cancel
Save