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

Merge branch '54-disable-tap-on-cell-while-animation-is-in-progress' into 'master'

Resolve "Disable tap on cell while animation is in progress"

Closes #54

See merge request !52
parents be5ae9f2 f2167503
No related branches found
Tags Release_1.0.43_44
1 merge request!52Resolve "Disable tap on cell while animation is in progress"
Pipeline #4903 passed
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=1.0.42
app.versionCode=43
app.versionName=1.0.43
app.versionCode=44
......@@ -153,14 +153,27 @@ class _GameBoardWidget extends State<GameBoardWidget> with TickerProviderStateMi
return GestureDetector(
child: buildBoard(),
onTapUp: (details) {
double xTap = details.localPosition.dx;
double yTap = details.localPosition.dy;
int x = (xTap / widgetWidth * columnsCount).toInt();
int y = (yTap / widgetHeight * rowsCount).toInt();
print('[' + x.toString() + ',' + y.toString() + ']');
removeCell(context, x, y);
bool canRemoveCell = true;
animations.forEach((row) {
row.forEach((cell) {
if (cell != null) {
canRemoveCell = false;
}
});
});
if (canRemoveCell) {
double xTap = details.localPosition.dx;
double yTap = details.localPosition.dy;
int x = (xTap / widgetWidth * columnsCount).toInt();
int y = (yTap / widgetHeight * rowsCount).toInt();
print('[' + x.toString() + ',' + y.toString() + ']');
removeCell(context, x, y);
} else {
print('animation in progress...');
}
},
);
}
......
......@@ -3,7 +3,7 @@ description: A random application, for testing purpose only.
publish_to: 'none'
version: 1.0.42+43
version: 1.0.43+44
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