上下左右滑动

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,

                ),

  

猜你喜欢

转载自www.cnblogs.com/pythonClub/p/10874518.html