Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何给出按钮抖动的条件_Flutter_Dart - Fatal编程技术网

Flutter 如何给出按钮抖动的条件

Flutter 如何给出按钮抖动的条件,flutter,dart,Flutter,Dart,如何给出按钮/墨水池等动作的条件 范例 InkWell( borderRadius: BorderRadius.all(Radius.circular(50.0)), if => onTap: () { capturephoto }); }, else => onLongPress: () { recordvideo

如何给出按钮/墨水池等动作的条件

范例

InkWell(
          borderRadius: BorderRadius.all(Radius.circular(50.0)),
          if => onTap: () {
            capturephoto
            });
          },
          else => onLongPress: () {
            recordvideo
            });
          },
          child: Container(
            padding: EdgeInsets.all(4.0),
            child: Image.asset(
              'assets/images/ic_switch_camera_3.png',
              color: Colors.grey[200],
              width: 42.0,
              height: 42.0,
            ),
          ),
        ),

当我点击它时,它可能是照片,如果我按下它,它可能是记录,你不需要条件,只要像这样给出这两个值

InkWell(
      borderRadius: BorderRadius.all(Radius.circular(50.0)),
      onTap: () {
       // capturephoto
      },
      onLongPress: () {
        //recordvideo
      },
      child: Container(
        padding: EdgeInsets.all(4.0),
        child: Image.asset(
          'assets/images/ic_switch_camera_3.png',
          color: Colors.grey[200],
          width: 42.0,
          height: 42.0,
        ),
      ),
    ),