flutter 事件组件GestureDetector

古城微笑少年丶 2021-07-24 13:56 562阅读 0赞
  1. 用来给组件绑定事件
  2. GestureDetector(
  3. child:组件,
  4. ...事件
  5. onVerticalDragDown: (text){} 当点击时会触发,参数为点击坐标
  6. onVerticalDragEnd: (text){} 当松开鼠标时触发,参数为坐标

代码示例:

  1. GestureDetector(
  2. child:Padding(
  3. padding: EdgeInsets.only(right: 10),
  4. child:Icon(Icons.add_circle_outline) ,
  5. ),
  6. onTap: (){ },
  7. )

发表评论

表情:
评论列表 (有 0 条评论,562人围观)

还没有评论,来说两句吧...

相关阅读