flutter - 手势检测器在 3 指滑动时抛出异常
问题描述
我正在使用一个设置为三指滑动时截取屏幕截图的 mi 设备。因此,在我的应用程序中,当我Draggable
用三个手指滑动屏幕上的按钮时,mi 会接管手势并截取屏幕截图,我的应用程序会引发异常,导致按钮卡在 UI 中的某个位置。
那么关于如何处理异常的任何想法?
异常日志:
D/ViewRootImpl( 8546): cancle motionEvent because of threeGesture detecting
D/ViewRootImpl( 8546): cancle motionEvent because of threeGesture detecting
D/ViewRootImpl( 8546): cancle motionEvent because of threeGesture detecting
E/flutter ( 8546): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter ( 8546): 'package:flutter/src/gestures/converter.dart': Failed assertion: line 250 pos 18: 'state.down': is not true.
E/flutter ( 8546): #0 _AssertionError._doThrowNew (dart:core/runtime/liberrors_patch.dart:40:39)
E/flutter ( 8546): #1 _AssertionError._throwNew (dart:core/runtime/liberrors_patch.dart:36:5)
E/flutter ( 8546): #2 PointerEventConverter.expand (package:flutter/src/gestures/converter.dart:250:18)
E/flutter ( 8546): #3 _SyncIterator.moveNext (dart:core/runtime/libcore_patch.dart:151:12)
E/flutter ( 8546): #4 ListQueue.addAll (dart:collection/queue.dart:715:25)
E/flutter ( 8546): #5 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:83:27)
E/flutter ( 8546): #6 _invoke1 (dart:ui/hooks.dart:168:13)
E/flutter ( 8546): #7 _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)
D/ViewRootImpl( 8546): cancle motionEvent because of threeGesture detecting
I/chatty ( 8546): uid=10232(org.chimple.jamaica) identical 7 lines
D/ViewRootImpl( 8546): cancle motionEvent because of threeGesture detecting
解决方案
推荐阅读
- powershell - 如何使用powershell脚本删除小于x kb的文件
- deeplab - deeplab 预测黑色蒙版
- rancher - 集群外的牧场主反向代理
- java - 在通话期间使用设备麦克风
- python - 如何更改我的 python 乌龟窗口的大小?
- java - Java - 日期时区转换
- c# - 在 Office 365 iframe 上使用 C# 本地显示访问 word 文档
- python - 我想检查在线视频是否正在流式传输。如何在 Python 中做到这一点?
- node.js - Node.js - 使用 .bashrc 初始化的 exec shell 命令
- apache-spark - 如何使用 regexp_replace() 从 spark 数据集中替换 Ctrl+M 字符?