Merge pull request #921 from abarth/use_tap

Use GestureDetector in the framework and examples
This commit is contained in:
Adam Barth
2015-08-28 12:52:51 -07:00

View File

@@ -107,19 +107,19 @@ class MineDiggerApp extends App {
state = cells[iy][ix] ? CellState.shown : state;
}
if (state == CellState.covered) {
row.add(new Listener(
onPointerDown: _pointerDownHandlerFor(ix, iy),
onGestureTap: (_) {
probe(ix, iy);
},
onGestureLongPress: (_) {
row.add(new GestureDetector(
onTap: () => probe(ix, iy),
onLongPress: () {
activity.userFeedback.performHapticFeedback(activity.HapticFeedbackType_LONG_PRESS);
flag(ix, iy);
},
child: new CoveredMineNode(
flagged: false,
posX: ix,
posY: iy
child: new Listener(
onPointerDown: _pointerDownHandlerFor(ix, iy),
child: new CoveredMineNode(
flagged: false,
posX: ix,
posY: iy
)
)
));
// Mutating |hasCoveredCell| here is hacky, but convenient, same