mirror of https://github.com/flutter/pinball.git
parent
f1928f39f9
commit
ddf2a03be3
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:pinball/l10n/l10n.dart';
|
||||||
|
import 'package:pinball/start_game/start_game.dart';
|
||||||
|
import 'package:pinball_ui/pinball_ui.dart';
|
||||||
|
|
||||||
|
/// {@template replay_button_overlay}
|
||||||
|
/// [Widget] that renders the button responsible to restart the game
|
||||||
|
/// {@endtemplate}
|
||||||
|
class ReplayButtonOverlay extends StatelessWidget {
|
||||||
|
/// {@macro replay_button_overlay}
|
||||||
|
const ReplayButtonOverlay({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final l10n = context.l10n;
|
||||||
|
|
||||||
|
return PinballButton(
|
||||||
|
text: l10n.replay,
|
||||||
|
onTap: () {
|
||||||
|
context.read<StartGameBloc>().add(const PlayTapped());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
export 'bonus_animation.dart';
|
export 'bonus_animation.dart';
|
||||||
export 'game_hud.dart';
|
export 'game_hud.dart';
|
||||||
export 'play_button_overlay.dart';
|
export 'play_button_overlay.dart';
|
||||||
|
export 'replay_button_overlay.dart';
|
||||||
export 'round_count_display.dart';
|
export 'round_count_display.dart';
|
||||||
export 'score_view.dart';
|
export 'score_view.dart';
|
||||||
|
Loading…
Reference in new issue