Skip to content

Commit

Permalink
Merge branch 'main' into fix/hints-response
Browse files Browse the repository at this point in the history
  • Loading branch information
jsgalarraga committed Apr 25, 2024
2 parents 216d123 + 4326072 commit eb8962c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/hint/bloc/hint_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class HintBloc extends Bloc<HintEvent, HintState> {
PreviousHintsRequested event,
Emitter<HintState> emit,
) async {
final isHintsEnabled = await _boardInfoRepository.isHintsEnabled().last;
final isHintsEnabled = await _boardInfoRepository.isHintsEnabled().first;
if (state.hints.isEmpty && isHintsEnabled) {
final (hints, maxHints) =
await _hintResource.getHints(wordId: event.wordId);
Expand Down
20 changes: 10 additions & 10 deletions lib/word_selection/view/word_solving_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ class WordSolvingLargeView extends StatelessWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
if (isHintsEnabled) ...[
const HintsTitle(),
const SizedBox(height: 32),
],
Flexible(
child: BlocSelector<WordSelectionBloc, WordSelectionState,
WordSelectionStatus>(
Expand All @@ -78,7 +74,11 @@ class WordSolvingLargeView extends StatelessWidget {
],
),
),
const SizedBox(height: 16),
const SizedBox(height: 24),
if (isHintsEnabled) ...[
const HintsTitle(),
const SizedBox(height: 32),
],
const BottomPanel(),
],
);
Expand Down Expand Up @@ -128,10 +128,6 @@ class _WordSolvingSmallViewState extends State<WordSolvingSmallView> {
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
if (isHintsEnabled) ...[
const HintsTitle(),
const SizedBox(height: 32),
],
Expanded(
child: BlocSelector<WordSelectionBloc, WordSelectionState,
WordSelectionStatus>(
Expand All @@ -148,7 +144,11 @@ class _WordSolvingSmallViewState extends State<WordSolvingSmallView> {
},
),
),
const SizedBox(height: 16),
const SizedBox(height: 24),
if (isHintsEnabled) ...[
const HintsTitle(),
const SizedBox(height: 32),
],
const BottomPanel(),
],
);
Expand Down
2 changes: 1 addition & 1 deletion test/hint/bloc/hint_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void main() {
'does not emit state when hints are disabled',
setUp: () {
when(() => boardInfoRepository.isHintsEnabled()).thenAnswer(
(_) => Stream.fromIterable([true, false]),
(_) => Stream.value(false),
);
},
build: () => HintBloc(
Expand Down

0 comments on commit eb8962c

Please sign in to comment.