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

Improve select picture page layout

parent 98146c59
No related branches found
No related tags found
1 merge request!35Resolve "Improve select picture page"
Pipeline #1709 passed
This commit is part of merge request !35. Comments created here will be created in the context of that merge request.
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.33
app.versionCode=33
app.versionName=0.0.34
app.versionCode=34
......@@ -16,7 +16,7 @@ class Home extends StatelessWidget {
Color themePrimaryColor = Colors.blue;
double _tipImageSize = 100;
int _selectImageColumnsCount = 2;
int _selectImageColumnsCount = 3;
Future<void> resetGame(Data myProvider) async {
myProvider.updateImage = '';
......@@ -55,9 +55,10 @@ class Home extends StatelessWidget {
myProvider.updateImages = images;
}
Container _buildImageSelectorItem(Data myProvider, String image, double selectImageSize, double tileImageSize) {
Container _buildImageSelectorItem(Data myProvider, String image, double tileImageSize) {
return Container(
child: FlatButton(
padding: EdgeInsets.all(2),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
......@@ -66,11 +67,8 @@ class Home extends StatelessWidget {
width: 4,
),
),
margin: EdgeInsets.all(2),
child: Image(
image: AssetImage(getImageAssetName(image)),
width: selectImageSize,
height: selectImageSize,
fit: BoxFit.fill
),
),
......@@ -79,7 +77,7 @@ class Home extends StatelessWidget {
);
}
Container _buildImageSelector(Data myProvider, double size, double tileImageSize) {
Container _buildImageSelector(Data myProvider, double tileImageSize) {
if (myProvider.images.length == 0) {
getImagesList(myProvider);
}
......@@ -99,7 +97,11 @@ class Home extends StatelessWidget {
Column(
children: [
if (imageIndex + columnIndex < images.length)
_buildImageSelectorItem(myProvider, images[imageIndex + columnIndex], size, tileImageSize)
_buildImageSelectorItem(
myProvider,
images[imageIndex + columnIndex],
tileImageSize
)
]
),
]
......@@ -369,7 +371,6 @@ class Home extends StatelessWidget {
var content;
double _selectorImageSize = (MediaQuery.of(context).size.width - 140) / _selectImageColumnsCount;
double _tileImageSize = (MediaQuery.of(context).size.width - 70) / _myProvider.tilesCount;
if (_myProvider.isShufflingBoard) {
......@@ -377,7 +378,7 @@ class Home extends StatelessWidget {
precacheImage(new AssetImage('assets/icons/game_win.png'), context);
} else {
if (_myProvider.image == '') {
content = _buildImageSelector(_myProvider, _selectorImageSize, _tileImageSize);
content = _buildImageSelector(_myProvider, _tileImageSize);
} else {
content = _buildGameWidget(_myProvider);
}
......
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