Closed slovnicki closed 3 years ago
Oh, yeah, I think this answers the question
//? does this null aware opertor work here?
'${state.winner.name ?? 'Nobody'}'
it should probably be ${state.winner?.name ?? 'Nobody'}
════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building BlocBuilder<GameBloc, GameState>(dirty, state: _BlocBuilderBaseState<GameBloc, GameState>#148b3):
The getter 'name' was called on null.
Receiver: null
Tried calling: name
The relevant error-causing widget was
BlocBuilder<GameBloc, GameState>
package:tic_tac_no/…/ui/game_screen.dart:72
When the exception was thrown, this was the stack
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 GameScreenState.build.<anonymous closure>
package:tic_tac_no/…/ui/game_screen.dart:81
#2 BlocBuilder.build
package:flutter_bloc/src/bloc_builder.dart:93
#3 _BlocBuilderBaseState.build
package:flutter_bloc/src/bloc_builder.dart:153
#4 StatefulElement.build
package:flutter/…/widgets/framework.dart:4801
...
Oh, and it seems that confetti is also running on draw. Maybe it would be better it didn't :)
Fixed. No confetti too. Took way to long to synthesise a draw :P
Fixed in latest commit