|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:pinball/game/pinball_game.dart';
|
|
|
|
|
import 'package:pinball/l10n/l10n.dart';
|
|
|
|
|
import 'package:pinball/theme/theme.dart';
|
|
|
|
|
|
|
|
|
|
/// {@template play_button_overlay}
|
|
|
|
|
/// [Widget] that renders the button responsible to starting the game
|
|
|
|
@ -18,9 +19,28 @@ class PlayButtonOverlay extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final l10n = context.l10n;
|
|
|
|
|
|
|
|
|
|
return Center(
|
|
|
|
|
child: ElevatedButton(
|
|
|
|
|
onPressed: _game.gameFlowController.start,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
_game.gameFlowController.start();
|
|
|
|
|
showDialog<void>(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (_) {
|
|
|
|
|
final width = MediaQuery.of(context).size.width * 0.9;
|
|
|
|
|
final height = MediaQuery.of(context).size.height * 0.9;
|
|
|
|
|
|
|
|
|
|
return Center(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: height,
|
|
|
|
|
width: width,
|
|
|
|
|
child: const CharacterSelectionPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Text(l10n.play),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|