mirror of https://github.com/flutter/pinball.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
682 B
26 lines
682 B
import 'package:flame/game.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:pinball/game/game.dart';
|
|
|
|
class PinballGameView extends StatelessWidget {
|
|
const PinballGameView({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocListener<GameBloc, GameState>(
|
|
listener: (context, state) {
|
|
if (state.isGameOver) {
|
|
showDialog<void>(
|
|
context: context,
|
|
builder: (_) {
|
|
return const GameOverDialog();
|
|
},
|
|
);
|
|
}
|
|
},
|
|
child: GameWidget<PinballGame>(game: PinballGame()),
|
|
);
|
|
}
|
|
}
|