Use GestureDetector in the framework and examples

We're now using it at the widget layer for everything except scrolling and
flinging.
This commit is contained in:
Adam Barth 2015-08-28 10:58:06 -07:00
parent a3774a757f
commit dd7e42eeb3

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