refactor: use rounds instead of balls

pull/213/head
RuiAlonso 3 years ago
parent b3c767636f
commit 18c12bce7d

@ -14,9 +14,7 @@ class RoundCountDisplay extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
// TODO(arturplaczek): refactor when GameState handle balls and rounds and
// select state.rounds property instead of state.ball
final balls = context.select((GameBloc bloc) => bloc.state.balls);
final balls = context.select((GameBloc bloc) => bloc.state.rounds);
return Row(
children: [

@ -18,7 +18,9 @@ void main() {
const initialState = GameState(
score: 1000,
multiplier: 1,
balls: 2,
rounds: 1,
bonusHistory: [],
);

@ -11,7 +11,9 @@ void main() {
late GameBloc gameBloc;
const initialState = GameState(
score: 0,
balls: 3,
multiplier: 1,
balls: 1,
rounds: 3,
bonusHistory: [],
);
@ -37,7 +39,7 @@ void main() {
testWidgets('two active round indicator', (tester) async {
final state = initialState.copyWith(
balls: 2,
rounds: 2,
);
whenListen(
gameBloc,
@ -68,7 +70,7 @@ void main() {
testWidgets('one active round indicator', (tester) async {
final state = initialState.copyWith(
balls: 1,
rounds: 1,
);
whenListen(
gameBloc,

@ -15,7 +15,9 @@ void main() {
const score = 123456789;
const initialState = GameState(
score: score,
multiplier: 1,
balls: 1,
rounds: 1,
bonusHistory: [],
);
@ -46,7 +48,7 @@ void main() {
stateController.add(
initialState.copyWith(
balls: 0,
rounds: 0,
),
);

Loading…
Cancel
Save