• Flutter手势--GestureDetector各种手势使用详情


    1.GestureDetector单击手势

    序列号字段属性描述
    1onTapDownGestureTapDownCallback手指按下时的回调函数
    2onTapUpGestureTapUpCallback手指松开时的回调函数
    3onTapGestureTapCallback手指点击时的回调函数
    4onTapCancelGestureTapCancelCallback手指取消点击时的回调函数

    我们在Container容器上添加了单击手势,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. @override
    8. Widget build(BuildContext context) {
    9. return Scaffold(
    10. appBar: AppBar(
    11. title: Text("GestureDetector"),
    12. ),
    13. body: Center(
    14. child: Stack(
    15. children: [
    16. GestureDetector(
    17. onTap: (){
    18. print("onTap");
    19. },
    20. onTapCancel: () {
    21. print("onTapCancel");
    22. },
    23. onTapDown: (details) {
    24. print("onTapDown---${details.globalPosition}---${details.localPosition}");
    25. },
    26. onTapUp: (details) {
    27. print("onTapUp---${details.globalPosition}---${details.localPosition}");
    28. },
    29. child: Container(
    30. width: 200,
    31. height: 200,
    32. color: Colors.orange,
    33. alignment: Alignment.center,
    34. child: Text("Jimi",
    35. style: TextStyle(
    36. color: Colors.white,
    37. fontSize: 30
    38. ),
    39. ),
    40. ),
    41. )
    42. ],
    43. ),
    44. ),
    45. );
    46. }
    47. }

    GestureDetector单击手势控制台输出结果

    第一种:点击Container容器

    1. flutter: onTapDown---Offset(211.5, 317.0)---Offset(124.0, 45.5)
    2. flutter: onTapUp---Offset(211.5, 317.0)---Offset(124.0, 45.5)
    3. flutter: onTap

    第二种:点击Container容器后不松手直接移出区域

    1. flutter: onTapDown---Offset(195.5, 305.5)---Offset(108.0, 34.0)
    2. flutter: onTapCancel

    2.GestureDetector双击手势

    序列号字段属性描述
    1onDoubleTapDownGestureTapDownCallback手指按下时的回调函数
    2onDoubleTapGestureTapCallback手指双击时的回调函数
    3onDoubleTapCancelGestureTapCancelCallback手指取消时的回调函数

    我们在Container容器上添加了三种双击手势的回调,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. @override
    8. Widget build(BuildContext context) {
    9. return Scaffold(
    10. appBar: AppBar(
    11. title: Text("GestureDetector"),
    12. ),
    13. body: Center(
    14. child: Stack(
    15. children: [
    16. GestureDetector(
    17. onDoubleTap: () {
    18. print("onTapDown");
    19. },
    20. onDoubleTapCancel: () {
    21. print("onDoubleTapCancel");
    22. },
    23. onDoubleTapDown: (details) {
    24. print("onDoubleTapDown---${details.globalPosition}---${details.localPosition}");
    25. },
    26. child: Container(
    27. width: 200,
    28. height: 200,
    29. color: Colors.orange,
    30. alignment: Alignment.center,
    31. child: Text("Jimi",
    32. style: TextStyle(
    33. color: Colors.white,
    34. fontSize: 30
    35. ),
    36. ),
    37. ),
    38. )
    39. ],
    40. ),
    41. ),
    42. );
    43. }
    44. }

    GestureDetector双击手势控制台输出结果

    第一种:双击Container容器

    1. flutter: onDoubleTapDown---Offset(204.5, 317.0)---Offset(117.0, 45.5)
    2. flutter: onTapDown

    第二种:双击Container容器但不抬起手指并移出区域

    1. flutter: onDoubleTapDown---Offset(195.5, 283.5)---Offset(108.0, 12.0)
    2. flutter: onDoubleTapCancel

    3.GestureDetector长按手势

    序列号字段属性描述
    1onLongPressDownGestureLongPressDownCallback手指按下去时的回调函数
    2onLongPressCancelGestureLongPressCancelCallback手指长按取消时的回调函数
    3onLongPressGestureLongPressCallback手指长按时的回调函数
    4onLongPressStartGestureLongPressStartCallback手指长按并开始拖动时的回调函数
    5onLongPressMoveUpdateGestureLongPressMoveUpdateCallback手指长按并移动时的回调函数
    6onLongPressUpGestureLongPressUpCallback手指长按并松开时的回调函数
    7onLongPressEndGestureLongPressEndCallback手指长按结束拖动时的回调函数

    我们在Container容器上添加了长按手势,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. @override
    8. Widget build(BuildContext context) {
    9. return Scaffold(
    10. appBar: AppBar(
    11. title: Text("GestureDetector"),
    12. ),
    13. body: Center(
    14. child: Stack(
    15. children: [
    16. GestureDetector(
    17. onLongPress: (){
    18. print("onLongPress");
    19. },
    20. onLongPressCancel: () {
    21. print("onLongPressCancel");
    22. },
    23. onLongPressUp: () {
    24. print("onLongPressUp");
    25. },
    26. onLongPressDown: (details) {
    27. print("onLongPressDown---${details.globalPosition}---${details.localPosition}");
    28. },
    29. onLongPressEnd: (details) {
    30. print("onLongPressEnd---${details.globalPosition}---${details.localPosition}");
    31. },
    32. onLongPressStart: (details) {
    33. print("onLongPressStart---${details.globalPosition}---${details.localPosition}");
    34. },
    35. onLongPressMoveUpdate: (details) {
    36. print("onLongPressMoveUpdate---${details.globalPosition}---${details.localPosition}");
    37. },
    38. child: Container(
    39. width: 200,
    40. height: 200,
    41. color: Colors.orange,
    42. alignment: Alignment.center,
    43. child: Text("Jimi",
    44. style: TextStyle(
    45. color: Colors.white,
    46. fontSize: 30
    47. ),
    48. ),
    49. ),
    50. )
    51. ],
    52. ),
    53. ),
    54. );
    55. }
    56. }

    GestureDetector长按手势控制台输出结果

    第一种:单击Container容器

    1. flutter: onLongPressDown---Offset(199.0, 336.0)---Offset(111.5, 64.5)
    2. flutter: onLongPressCancel

    第二种:长按Container容器但是手指不动后松开

    1. flutter: onLongPressDown---Offset(215.0, 301.0)---Offset(127.5, 29.5)
    2. flutter: onLongPressStart---Offset(215.0, 301.0)---Offset(127.5, 29.5)
    3. flutter: onLongPress
    4. flutter: onLongPressEnd---Offset(215.0, 301.0)---Offset(127.5, 29.5)
    5. flutter: onLongPressUp

    第三种:长按Container容器并进行拖动最后松开手指

    1. flutter: onLongPressDown---Offset(169.0, 314.0)---Offset(81.5, 42.5)
    2. flutter: onLongPressStart---Offset(169.0, 314.0)---Offset(81.5, 42.5)
    3. flutter: onLongPress
    4. flutter: onLongPressMoveUpdate---Offset(168.5, 314.5)---Offset(81.0, 43.0)
    5. flutter: onLongPressMoveUpdate---Offset(165.0, 318.5)---Offset(77.5, 47.0)
    6. flutter: onLongPressMoveUpdate---Offset(164.0, 319.0)---Offset(76.5, 47.5)
    7. flutter: onLongPressMoveUpdate---Offset(158.5, 323.5)---Offset(71.0, 52.0)
    8. flutter: onLongPressMoveUpdate---Offset(153.0, 329.5)---Offset(65.5, 58.0)
    9. flutter: onLongPressMoveUpdate---Offset(148.5, 335.0)---Offset(61.0, 63.5)
    10. flutter: onLongPressMoveUpdate---Offset(146.5, 339.0)---Offset(59.0, 67.5)
    11. flutter: onLongPressMoveUpdate---Offset(146.5, 339.5)---Offset(59.0, 68.0)
    12. flutter: onLongPressEnd---Offset(146.5, 339.5)---Offset(59.0, 68.0)
    13. flutter: onLongPressUp

    第四种:长按Container容器并马上移出区域

    1. flutter: onLongPressDown---Offset(97.0, 277.5)---Offset(9.5, 6.0)
    2. flutter: onLongPressCancel
    3. flutter: onLongPressDown---Offset(91.5, 275.5)---Offset(4.0, 4.0)
    4. flutter: onLongPressCancel

    4.GestureDetector垂直滑动手势

    序列号字段属性描述
    1onVerticalDragDownGestureDragDownCallback手指按下时的回调函数
    2onVerticalDragStartGestureDragStartCallback手指开始垂直滑动时的回调函数
    3onVerticalDragUpdateGestureDragUpdateCallback手指垂直滑动时的回调函数
    4onVerticalDragEndGestureDragEndCallback手指垂直滑动结束时的回调函数
    5onVerticalDragCancelGestureDragCancelCallback手指垂直滑动取消时的回调函数

    我们在Container容器上添加了垂直滑动手势,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. double _left = 0;
    8. double _top = 0;
    9. @override
    10. Widget build(BuildContext context) {
    11. return Scaffold(
    12. appBar: AppBar(
    13. title: Text("GestureDetector"),
    14. ),
    15. body: Center(
    16. child: Stack(
    17. children: [
    18. GestureDetector(
    19. onVerticalDragCancel: () {
    20. print("onVerticalDragCancel");
    21. },
    22. onVerticalDragDown: (details) {
    23. print("onVerticalDragDown---${details.globalPosition}---${details.localPosition}");
    24. },
    25. onVerticalDragEnd: (details) {
    26. print("onVerticalDragEnd---${details.velocity}---${details.primaryVelocity}");
    27. },
    28. onVerticalDragStart: (details) {
    29. print("onVerticalDragStart---${details.globalPosition}---${details.localPosition}");
    30. },
    31. onVerticalDragUpdate: (details) {
    32. print("onVerticalDragUpdate---${details.globalPosition}---${details.localPosition}---${details.delta}");
    33. setState(() {
    34. _top += details.delta.dy;
    35. });
    36. },
    37. child: Stack(
    38. children: [
    39. Positioned(
    40. left: _left,
    41. top: _top,
    42. child: Container(
    43. width: 200,
    44. height: 200,
    45. color: Colors.orange,
    46. alignment: Alignment.center,
    47. child: Text("Jimi",
    48. style: TextStyle(
    49. color: Colors.white,
    50. fontSize: 30
    51. ),
    52. ),
    53. ),
    54. )
    55. ],
    56. ),
    57. )
    58. ],
    59. ),
    60. ),
    61. );
    62. }
    63. }

    GestureDetector垂直滑动手势控制台输出

    第一种:点击Container容器

    1. flutter: onVerticalDragDown---Offset(76.5, 114.5)---Offset(76.5, 38.5)
    2. flutter: onVerticalDragStart---Offset(76.5, 114.5)---Offset(76.5, 38.5)
    3. flutter: onVerticalDragEnd---Velocity(0.0, 0.0)---0.0

    第二种:拖动Container容器

    1. flutter: onVerticalDragDown---Offset(185.5, 332.5)---Offset(185.5, 256.5)
    2. flutter: onVerticalDragStart---Offset(185.5, 332.5)---Offset(185.5, 256.5)
    3. flutter: onVerticalDragUpdate---Offset(185.5, 332.0)---Offset(185.5, 256.0)
    4. flutter: onVerticalDragUpdate---Offset(187.5, 322.0)---Offset(187.5, 246.0)
    5. flutter: onVerticalDragUpdate---Offset(192.0, 307.0)---Offset(192.0, 231.0)
    6. flutter: onVerticalDragUpdate---Offset(193.5, 298.0)---Offset(193.5, 222.0)
    7. flutter: onVerticalDragUpdate---Offset(193.5, 297.0)---Offset(193.5, 221.0)
    8. flutter: onVerticalDragEnd---Velocity(131.3, -548.9)----548.8773895303548

    第三种:拖动Container容器并马上松开

    1. flutter: onVerticalDragDown---Offset(10.5, 93.5)---Offset(10.5, 17.5)
    2. flutter: onVerticalDragCancel

    5.GestureDetector水平滑动手势

    序列号字段属性描述
    1onHorizontalDragDownGestureDragDownCallback手指按下时的回调函数
    2onHorizontalDragStartGestureDragStartCallback手指开始水平滑动时的回调函数
    3onHorizontalDragUpdateGestureDragUpdateCallback手指水平滑动时的回调函数
    4onHorizontalDragEndGestureDragEndCallback手指水平滑动结束时的回调函数
    5onHorizontalDragCancelGestureDragCancelCallback手指水平滑动取消时的回调函数

    我们在Container容器上添加了水平滑动手势,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. double _left = 0;
    8. double _top = 0;
    9. @override
    10. Widget build(BuildContext context) {
    11. return Scaffold(
    12. appBar: AppBar(
    13. title: Text("GestureDetector"),
    14. ),
    15. body: Center(
    16. child: Stack(
    17. children: [
    18. /// 水平滑动
    19. GestureDetector(
    20. onHorizontalDragCancel: () {
    21. print("onHorizontalDragCancel");
    22. },
    23. onHorizontalDragDown: (details) {
    24. print("onHorizontalDragDown---${details.globalPosition}---${details.localPosition}");
    25. },
    26. onHorizontalDragEnd: (details) {
    27. print("onHorizontalDragEnd---${details.velocity}---${details.primaryVelocity}");
    28. },
    29. onHorizontalDragStart: (details) {
    30. print("onHorizontalDragStart---${details.globalPosition}---${details.localPosition}");
    31. },
    32. onHorizontalDragUpdate: (details) {
    33. print("onHorizontalDragUpdate---${details.globalPosition}---${details.localPosition}---${details.delta}");
    34. setState(() {
    35. _left += details.delta.dx;
    36. });
    37. },
    38. child: Stack(
    39. children: [
    40. Positioned(
    41. left: _left,
    42. top: _top,
    43. child: Container(
    44. width: 200,
    45. height: 200,
    46. color: Colors.orange,
    47. alignment: Alignment.center,
    48. child: Text("Jimi",
    49. style: TextStyle(
    50. color: Colors.white,
    51. fontSize: 30
    52. ),
    53. ),
    54. ),
    55. )
    56. ],
    57. ),
    58. )
    59. ],
    60. ),
    61. ),
    62. );
    63. }
    64. }

    GestureDetector水平滑动控制台输出

    第一种:点击Container容器

    1. flutter: onHorizontalDragDown---Offset(151.5, 118.0)---Offset(151.5, 42.0)
    2. flutter: onHorizontalDragStart---Offset(151.5, 118.0)---Offset(151.5, 42.0)
    3. flutter: onHorizontalDragEnd---Velocity(0.0, 0.0)---0.0

    第二种:拖动Container容器

    1. flutter: onHorizontalDragDown---Offset(97.5, 135.5)---Offset(97.5, 59.5)
    2. flutter: onHorizontalDragStart---Offset(97.5, 135.5)---Offset(97.5, 59.5)
    3. flutter: onHorizontalDragUpdate---Offset(100.0, 136.0)---Offset(100.0, 60.0)---Offset(2.5, 0.0)
    4. flutter: onHorizontalDragUpdate---Offset(100.5, 136.0)---Offset(100.5, 60.0)---Offset(0.5, 0.0)
    5. flutter: onHorizontalDragUpdate---Offset(102.0, 136.0)---Offset(102.0, 60.0)---Offset(1.5, 0.0)
    6. flutter: onHorizontalDragUpdate---Offset(105.0, 136.5)---Offset(105.0, 60.5)---Offset(3.0, 0.0)
    7. flutter: onHorizontalDragUpdate---Offset(107.0, 137.0)---Offset(107.0, 61.0)---Offset(2.0, 0.0)
    8. flutter: onHorizontalDragUpdate---Offset(108.5, 137.0)---Offset(108.5, 61.0)---Offset(1.5, 0.0)
    9. flutter: onHorizontalDragUpdate---Offset(109.0, 137.0)---Offset(109.0, 61.0)---Offset(0.5, 0.0)
    10. flutter: onHorizontalDragUpdate---Offset(110.0, 137.0)---Offset(110.0, 61.0)---Offset(1.0, 0.0)
    11. flutter: onHorizontalDragUpdate---Offset(111.0, 137.0)---Offset(111.0, 61.0)---Offset(1.0, 0.0)
    12. flutter: onHorizontalDragEnd---Velocity(0.0, 0.0)---0.0

    第三种:拖动Container容器并马上松开

    1. flutter: onHorizontalDragDown---Offset(6.0, 109.0)---Offset(6.0, 33.0)
    2. flutter: onHorizontalDragCancel

    6.GestureDetector拖动手势

    序列号字段属性描述
    1onPanDownGestureDragDownCallback手指按下时的回调函数
    2onPanStartGestureDragStartCallback手指开始拖动时的回调函数
    3onPanUpdateGestureDragUpdateCallback手指移动时的回调函数
    4onPanEndGestureDragEndCallback手指抬起时的回调函数
    5onPanCancelGestureDragCancelCallback手指取消拖动时的回调函数

    我们在Container容器上添加了拖动手势,代码如下:

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. double _left = 0;
    8. double _top = 0;
    9. @override
    10. Widget build(BuildContext context) {
    11. return Scaffold(
    12. appBar: AppBar(
    13. title: Text("GestureDetector"),
    14. ),
    15. body: Center(
    16. child: Stack(
    17. children: [
    18. // 拖动手势
    19. GestureDetector(
    20. onPanCancel: () {
    21. print("onPanCancel");
    22. },
    23. onPanDown: (details) {
    24. print("onPanDown---${details.globalPosition}---${details.localPosition}");
    25. },
    26. onPanEnd: (details) {
    27. print("onPanEnd---${details.velocity}---${details.primaryVelocity}");
    28. },
    29. onPanStart: (details) {
    30. print("onPanStart---${details.globalPosition}---${details.localPosition}");
    31. },
    32. onPanUpdate: (details) {
    33. print("onPanUpdate---${details.globalPosition}---${details.localPosition}---${details.delta}");
    34. setState(() {
    35. _left += details.delta.dx;
    36. _top += details.delta.dy;
    37. });
    38. },
    39. child: Stack(
    40. children: [
    41. Positioned(
    42. left: _left,
    43. top: _top,
    44. child: Container(
    45. width: 200,
    46. height: 200,
    47. color: Colors.orange,
    48. alignment: Alignment.center,
    49. child: Text("Jimi",
    50. style: TextStyle(
    51. color: Colors.white,
    52. fontSize: 30
    53. ),
    54. ),
    55. ),
    56. )
    57. ],
    58. ),
    59. )
    60. ],
    61. ),
    62. ),
    63. );
    64. }
    65. }

    GestureDetector拖动手势控制台输出

    第一种:点击Container容器

    1. flutter: onPanDown---Offset(161.0, 233.0)---Offset(161.0, 157.0)
    2. flutter: onPanStart---Offset(161.0, 233.0)---Offset(161.0, 157.0)
    3. flutter: onPanEnd---Velocity(0.0, 0.0)---0.0

    第二种:拖动Container容器

    1. flutter: onPanDown---Offset(123.5, 193.5)---Offset(123.5, 117.5)
    2. flutter: onPanStart---Offset(123.5, 193.5)---Offset(123.5, 117.5)
    3. flutter: onPanUpdate---Offset(123.5, 193.0)---Offset(123.5, 117.0)---Offset(0.0, -0.5)
    4. flutter: onPanUpdate---Offset(124.0, 193.0)---Offset(124.0, 117.0)---Offset(0.5, 0.0)
    5. flutter: onPanUpdate---Offset(124.5, 192.0)---Offset(124.5, 116.0)---Offset(0.5, -1.0)
    6. flutter: onPanUpdate---Offset(125.5, 190.5)---Offset(125.5, 114.5)---Offset(1.0, -1.5)
    7. flutter: onPanUpdate---Offset(126.0, 190.0)---Offset(126.0, 114.0)---Offset(0.5, -0.5)
    8. flutter: onPanUpdate---Offset(126.5, 189.5)---Offset(126.5, 113.5)---Offset(0.5, -0.5)
    9. flutter: onPanUpdate---Offset(127.0, 189.0)---Offset(127.0, 113.0)---Offset(0.5, -0.5)
    10. flutter: onPanEnd---Velocity(0.0, 0.0)---0.0

    第三种:拖动Container容器并马上松开

    1. flutter: onPanDown---Offset(5.5, 162.5)---Offset(5.5, 86.5)
    2. flutter: onPanCancel

    7.GestureDetector缩放手势

    序列号字段属性描述
    1onScaleStartGestureScaleStartCallback开始缩放时的回调函数
    2onScaleUpdateGestureScaleUpdateCallback缩放移动时的回调函数
    3onScaleEndGestureScaleEndCallback缩放结束时的回调函数

    我们在Container容器上添加了缩放手势,代码如下::

    1. import 'package:flutter/material.dart';
    2. class GestureDetectorExample extends StatefulWidget {
    3. @override
    4. _GestureDetectorExampleState createState() => _GestureDetectorExampleState();
    5. }
    6. class _GestureDetectorExampleState extends State<GestureDetectorExample> {
    7. double _left = 0;
    8. double _top = 0;
    9. double _widthAndHeight = 200;
    10. @override
    11. Widget build(BuildContext context) {
    12. return Scaffold(
    13. appBar: AppBar(
    14. title: Text("GestureDetector"),
    15. ),
    16. body: Center(
    17. child: Stack(
    18. children: [
    19. /// 缩放手势
    20. GestureDetector(
    21. onScaleEnd: (details) {
    22. print("onScaleEnd---${details.velocity}---${details.pointerCount}");
    23. },
    24. onScaleStart: (details) {
    25. print("onScaleStart---${details.focalPoint}---${details.pointerCount}");
    26. },
    27. onScaleUpdate: (details) {
    28. print("onScaleUpdate---${details.scale}---${details.scale.clamp(0.1, 1.2)}");
    29. setState(() {
    30. _widthAndHeight = 200 * details.scale.clamp(0.3, 1.8);
    31. });
    32. },
    33. child: Container(
    34. width: _widthAndHeight,
    35. height: _widthAndHeight,
    36. color: Colors.orange,
    37. alignment: Alignment.center,
    38. child: Text("Jimi",
    39. style: TextStyle(
    40. color: Colors.white,
    41. fontSize: 30
    42. ),
    43. ),
    44. ),
    45. )
    46. ],
    47. ),
    48. ),
    49. );
    50. }
    51. }

    第一种:点击Container容器

    1. flutter: onScaleStart---Offset(149.5, 348.0)---1
    2. flutter: onScaleEnd---Velocity(0.0, 0.0)---0

    第二种:单指拖动Container容器

    1. flutter: onScaleStart---Offset(178.0, 304.5)---1
    2. flutter: onScaleUpdate---1.0---1.0
    3. flutter: onScaleUpdate---1.0---1.0
    4. flutter: onScaleUpdate---1.0---1.0
    5. flutter: onScaleUpdate---1.0---1.0
    6. flutter: onScaleEnd---Velocity(0.0, 0.0)---0

    第三种:双指缩放Container容器

    1. flutter: onScaleStart---Offset(187.5, 333.5)---2
    2. flutter: onScaleUpdate---1.0055027720002572---1.0055027720002572
    3. flutter: onScaleUpdate---1.0110087715145855---1.0110087715145855
    4. flutter: onScaleUpdate---1.0293231946761667---1.0293231946761667
    5. flutter: onScaleUpdate---1.04763763435052---1.04763763435052
    6. flutter: onScaleUpdate---1.0531463022961167---1.0531463022961167
    7. flutter: onScaleEnd---Velocity(0.0, 0.0)---1

    8.带有3D Touch功能压力设备触发手势

    序列号字段属性描述
    1onForcePressStartGestureForcePressStartCallback手指强制按下时的回调函数
    2onForcePressPeakGestureForcePressPeakCallback手指按压力度最大时的回调函数
    3onForcePressUpdateGestureForcePressUpdateCallback手指按下后移动时的回调函数
    4onForcePressEndGestureForcePressEndCallback手指离开时的回调函数

    9.辅助按钮触发手势

    序列号字段属性描述
    1onSecondaryTapGestureTapCallback辅助按钮单击时的回调函数
    2onSecondaryTapDownGestureTapDownCallback辅助按钮按下时的回调函数
    3onSecondaryTapUpGestureTapUpCallback辅助按钮松开时的回调函数
    4onSecondaryTapCancelGestureTapCancelCallback辅助按钮取消点击时的回调函数
    5onSecondaryLongPressDownGestureLongPressDownCallback辅助按钮按下去时的回调函数
    6onSecondaryLongPressCancelGestureLongPressCancelCallback辅助按钮长按取消时的回调函数
    7onSecondaryLongPressGestureLongPressCallback辅助按钮长按时的回调函数
    8onSecondaryLongPressStartGestureLongPressStartCallback辅助按钮长按并开始拖动时的回调函数
    9onSecondaryLongPressMoveUpdateGestureLongPressMoveUpdateCallback辅助按钮长按并移动时的回调函数
    10onSecondaryLongPressUpGestureLongPressUpCallback辅助按钮长按并松开时的回调函数
    11onSecondaryLongPressEndGestureLongPressEndCallback辅助按钮长按结束拖动时的回调函数

    10.三指触发手势

    序列号字段属性描述
    1onTertiaryTapDownGestureTapDownCallback三指按下时的回调函数
    2onTertiaryTapUpGestureTapUpCallback三指点击时的回调函数
    3onTertiaryTapCancelGestureTapCancelCallback三指取消时的回调函数
    4onTertiaryLongPressDownGestureLongPressDownCallback三指按下去时的回调函数
    5onTertiaryLongPressCancelGestureLongPressCancelCallback三指长按取消时的回调函数
    6onTertiaryLongPressGestureLongPressCallback三指长按时的回调函数
    7onTertiaryLongPressStartGestureLongPressStartCallback三指长按并开始拖动时的回调函数
    8onTertiaryLongPressMoveUpdateGestureLongPressMoveUpdateCallback三指长按并移动时的回调函数
    9onTertiaryLongPressUpGestureLongPressUpCallback三指长按并松开时的回调函数
    10onTertiaryLongPressEndGestureLongPressEndCallback三指长按结束拖动时的回调函数

    11.其他属性

    序列号字段属性描述
    1childWidget子组件
    2behaviorHitTestBehavior在命中测试期间如何表现
    3excludeFromSemanticsbool是否从语义树中排除这些手势,默认false
    4dragStartBehaviorDragStartBehavior拖拽行为的处理方式

  • 相关阅读:
    JetPack--Navigation实现页面跳转
    【XML文件数据预处理】获取xml文件中所有标签名称及数量||提取某个特定标签的数量||生成包含某个标签的图片索引txt并复制图片到指定文件夹
    拒绝灵感焦虑,藏在UI设计师书签里的宝藏网站!
    算法排序6——快速排序(分治思想)
    Springboot毕设项目线上影院系统ao90djava+VUE+Mybatis+Maven+Mysql+sprnig)
    iOS Hook 崩溃
    C语言求字符串的长度
    Javaweb-JSP详解
    《canvas》之第5章 文本操作
    【毕业设计】基于SSM与VUE的在线医疗诊断跟踪系统
  • 原文地址:https://blog.csdn.net/eastWind1101/article/details/127978385