fix: apply code review

pull/184/head
arturplaczek 3 years ago
parent d2a46dc509
commit af65374aa6

@ -21,10 +21,10 @@ class StartGameBloc extends Bloc<StartGameEvent, StartGameState> {
final PinballGame _game; final PinballGame _game;
Future<void> _onSelectCharacter( void _onSelectCharacter(
SelectCharacter event, SelectCharacter event,
Emitter emit, Emitter<StartGameState> emit,
) async { ) {
_game.gameFlowController.start(); _game.gameFlowController.start();
emit( emit(
@ -34,10 +34,10 @@ class StartGameBloc extends Bloc<StartGameEvent, StartGameState> {
); );
} }
Future<void> _onHowToPlay( void _onHowToPlay(
HowToPlay event, HowToPlay event,
Emitter emit, Emitter<StartGameState> emit,
) async { ) {
emit( emit(
state.copyWith( state.copyWith(
status: StartGameStatus.howToPlay, status: StartGameStatus.howToPlay,
@ -45,10 +45,10 @@ class StartGameBloc extends Bloc<StartGameEvent, StartGameState> {
); );
} }
Future<void> _onPlay( void _onPlay(
Play event, Play event,
Emitter emit, Emitter<StartGameState> emit,
) async { ) {
emit( emit(
state.copyWith( state.copyWith(
status: StartGameStatus.play, status: StartGameStatus.play,

@ -6,16 +6,37 @@ part of 'start_game_bloc.dart';
abstract class StartGameEvent extends Equatable { abstract class StartGameEvent extends Equatable {
/// {@macro start_game_event} /// {@macro start_game_event}
const StartGameEvent(); const StartGameEvent();
}
/// {@template select_character}
/// Select character event.
/// {@endtemplate}
class SelectCharacter extends StartGameEvent {
/// {@macro select_character}
const SelectCharacter();
@override @override
List<Object> get props => []; List<Object> get props => [];
} }
/// Select character event. /// {@template how_to_play}
class SelectCharacter extends StartGameEvent {}
/// How to play event. /// How to play event.
class HowToPlay extends StartGameEvent {} /// {@endtemplate}
class HowToPlay extends StartGameEvent {
/// {@macro how_to_play}
const HowToPlay();
@override
List<Object> get props => [];
}
/// {@template play}
/// Play event. /// Play event.
class Play extends StartGameEvent {} /// {@endtemplate}
class Play extends StartGameEvent {
/// {@macro play}
const Play();
@override
List<Object> get props => [];
}

@ -40,7 +40,5 @@ class StartGameState extends Equatable {
} }
@override @override
List<Object> get props => [ List<Object> get props => [status];
status,
];
} }

Loading…
Cancel
Save