gpt4 book ai didi

发生 Flutter 错误 : The position being added ($position) has a smaller timestamp ($time) than its predecessor: $previousPoint

转载 作者:行者123 更新时间:2023-12-05 06:04:20 39 4
gpt4 key购买 nike

我用NestedScrollView构建的滚动页面有问题,开始滚动有一定概率报错,这里看报错:

I/flutter ( 6574): ══╡ EXCEPTION CAUGHT BY GESTURE LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6574): The following assertion was thrown while routing a pointer event:
I/flutter ( 6574): The position being added (Offset(71.3, 253.9)) has a smaller timestamp (106:11:02.860000)than its
I/flutter ( 6574): predecessor: _PointAtTime(Offset(71.0, 252.9) at 106:11:02.867000).
I/flutter ( 6574):
I/flutter ( 6574): When the exception was thrown, this was the stack:
I/flutter ( 6574): #0 IOSScrollViewFlingVelocityTracker.addPosition.<anonymous closure> (package:flutter/src/gestures/velocity_tracker.dart:307:7)
I/flutter ( 6574): #1 IOSScrollViewFlingVelocityTracker.addPosition (package:flutter/src/gestures/velocity_tracker.dart:311:6)
I/flutter ( 6574): #2 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:277:15)
I/flutter ( 6574): #3 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12)
I/flutter ( 6574): #4 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9)
I/flutter ( 6574): #5 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
I/flutter ( 6574): #6 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
I/flutter ( 6574): #7 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
I/flutter ( 6574): #8 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:358:19)
I/flutter ( 6574): #9 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:338:22)
I/flutter ( 6574): #10 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:267:11)
I/flutter ( 6574): #11 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:295:7)
I/flutter ( 6574): #12 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7)
I/flutter ( 6574): #13 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7)
I/flutter ( 6574): #17 _invoke1 (dart:ui/hooks.dart:265:10)
I/flutter ( 6574): #18 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
I/flutter ( 6574): (elided 3 frames from dart:async)
I/flutter ( 6574):
I/flutter ( 6574): router: Instance of 'PointerRouter'
I/flutter ( 6574): route: Closure: (PointerEvent) => void from Function 'handleEvent':.
I/flutter ( 6574): event: PointerMoveEvent#0e017(position: Offset(71.3, 372.3))
I/flutter ( 6574): ════════════════════════════════════════════════════════════════════════════════════════════════════

Flutter 环境信息:

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, localezh-汉斯-CN)• Flutter 版本 1.22.5,位于/Users/fox/Documents/flutter• 框架修订版 7891006299(3 个月前),2020-12-10 11:54:40 -0800• 引擎版本 ae90085a84• Dart 版本 2.10.4• pub 下载镜像https://pub.flutter-io.cn• Flutter下载镜像https://storage.flutter-io.cn

[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 30.0.3)• Android SDK 位于/Users/fox/Library/Android/sdk• 平台 android-30,构建工具 30.0.3• Java 二进制文件位于:/Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home/bin/java• Java 版本 OpenJDK 运行时环境(构建1.8.0_242-release-1644-b3-6915495)• 接受所有 Android 许可。

[✓] Xcode - 为 iOS 和 macOS 开发 (Xcode 12.3)• Xcode 位于/Applications/Xcode.app/Contents/Developer• Xcode 12.3,构建版本 12C33• CocoaPods 版本 1.10.1

[!] Android Studio(版本 4.1)• Android Studio 位于/Applications/Android Studio.app/Contents✗ 未安装 Flutter 插件;这增加了 Flutter 特定的功能。✗ 未安装 Dart 插件;这增加了 Dart 特定的功能。• Java 版本 OpenJDK 运行时环境(构建1.8.0_242-release-1644-b3-6915495)

[✓] 连接的设备(2 个可用)• YAL AL10(手机) • 6QDDU19627031486 •android-arm64 • 安卓 10(API 29)• iPhone 12 Pro Max(手机) • BFF76ECD-93DE-4C0F-A171-BC1B705FF802 • ios• com.apple.CoreSimulator.SimRuntime.iOS-14-3(模拟器)

!医生发现了 1 个类别的问题。

最佳答案

我通过删除 main.dart 文件中的以下行解决了这个问题:

GestureBinding.instance!.resamplingEnabled = true;

关于发生 Flutter 错误 : The position being added ($position) has a smaller timestamp ($time) than its predecessor: $previousPoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66331241/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com