반응형
import 'dart:async';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wordgame/features/game/presentation/bloc/game_event.dart';
import 'package:wordgame/features/game/presentation/bloc/game_state.dart';
class GameBloc extends Bloc<GameEvent, GameState>{
GameBloc() : super(GameState.initial()){
on<StartGameEvent>(onStartGameEvent);
}
Future onStartGameEvent(StartGameEvent event, Emitter<GameState> emit) async {
emit(state.copyWith(
status: GameStatus.inProgress,
word: 'TEST',
attemptsCount: event.attemptsCount
));
}
}반응형
'새내기 게임 개발자[Unity]' 카테고리의 다른 글
| Flutter Word Game features/game/presentation/bloc/game_state.dart (0) | 2025.10.19 |
|---|---|
| Flutter Word Game features/game/presentation/bloc/game_event.dart (0) | 2025.10.19 |
| Flutter Word Game main code (0) | 2025.10.19 |
| Flutter 기본교육 - 부트캠프 - 1 (0) | 2025.10.14 |
| Unity 인기많은 무료 에셋 검색 및 목록추가 (3) | 2025.08.11 |