Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide move list in zen mode #832

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/view/game/game_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class GameBody extends ConsumerWidget {
onSelectMove: (moveIndex) {
ref.read(ctrlProvider.notifier).cursorAt(moveIndex);
},
zenMode: gameState.isZenModeActive,
),
),
),
Expand Down
9 changes: 7 additions & 2 deletions lib/src/widgets/board_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class BoardTable extends ConsumerStatefulWidget {
this.showMoveListPlaceholder = false,
this.showEngineGaugePlaceholder = false,
this.boardKey,
this.zenMode = false,
super.key,
}) : assert(
moves == null || currentMoveIndex != null,
Expand Down Expand Up @@ -91,6 +92,9 @@ class BoardTable extends ConsumerStatefulWidget {
/// Whether to show the engine gauge placeholder.
final bool showEngineGaugePlaceholder;

/// If true, the move list will be hidden
final bool zenMode;

@override
ConsumerState<BoardTable> createState() => _BoardTableState();
}
Expand Down Expand Up @@ -242,7 +246,7 @@ class _BoardTableState extends ConsumerState<BoardTable> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Flexible(child: widget.topTable),
if (slicedMoves != null)
if (!widget.zenMode && slicedMoves != null)
Expanded(
child: Padding(
padding: const EdgeInsets.all(16.0),
Expand Down Expand Up @@ -274,7 +278,8 @@ class _BoardTableState extends ConsumerState<BoardTable> {
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (slicedMoves != null &&
if (!widget.zenMode &&
slicedMoves != null &&
verticalSpaceLeftBoardOnPortrait >= 130)
MoveList(
type: MoveListType.inline,
Expand Down