Skip to content
Snippets Groups Projects
Commit 6fafd712 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '3-fix-display-big-vertical-board' into 'master'

Resolve "Fix display big vertical board"

Closes #3

See merge request !2
parents 060a001d 24f8a397
Branches 6-improve-app-metadata
Tags Release_0.0.2_2
1 merge request!2Resolve "Fix display big vertical board"
Pipeline #7775 passed
Fix display big vertical grids.
Correction sur l'affichage des grandes grilles verticales.
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
......@@ -124,18 +123,7 @@ class CellWidget extends StatelessWidget {
const Color cellBorderSelectedColor = Colors.red;
Color cellBorderColor = cellBorderSelectedColor;
double cellBorderWidth = 4;
final int boardSizeReference =
max(activity.boardSizeHorizontal, activity.boardSizeVertical);
// Reduce cell border width on big boards
if (boardSizeReference > 8) {
cellBorderWidth = 2;
if (boardSizeReference > 10) {
cellBorderWidth = 1;
}
}
final double cellBorderWidth = 4;
if (!activity.isRunning) {
cellBorderColor = Colors.green.shade700;
......
import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
......@@ -17,7 +18,11 @@ class GameBoardWidget extends StatelessWidget {
final Color borderColor = Theme.of(context).colorScheme.onSurface;
return Container(
final Size size = MediaQuery.of(context).size;
final double width = size.width;
final double height = size.height;
final Container board = Container(
margin: const EdgeInsets.all(2),
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
......@@ -81,6 +86,16 @@ class GameBoardWidget extends StatelessWidget {
],
),
);
return ConstrainedBox(
constraints: BoxConstraints.tightFor(
width: width,
height: height * .6,
),
child: FittedBox(
child: board,
), //Text
);
},
);
}
......
......@@ -3,7 +3,7 @@ description: A suguru game application.
publish_to: "none"
version: 0.0.1+1
version: 0.0.2+2
environment:
sdk: "^3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment