child: GestureDetector( onHorizontalDragEnd: (endDetails){ double velocity = endDetails.primaryVelocity; if (velocity < 0) { print('left'); } else { print('right'); } }, onVerticalDragEnd: (endDetails) { double velocity = endDetails.primaryVelocity; if (velocity < 0) { print('up'); } else { print('down'); } }, child: Stack( children: brickMatrix, ),