mapbox / mapbox/mapbox-maps-flutter

TransparentPointer fail

未关闭
#116 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Dart
星标
380
派生
204
PR 合并指标
30 天内没有已合并 PR

描述

I'm trying to switch from using the flutter-mapbox-gl plugin to this one, and I ran into an issue...

I'm using a transparent pointer over the map, in a Stack widget, so I can turn off some automated panning and zooming if the user starts interacting with the map; I'm interpreting gestures as pans, zooms, and rotates, and also letting the gestures bubble through to the map. This works fine with that other mapbox plugin, but with this one I get:

I/flutter ( 8823): ⚠️ Unhandled Flutter error: 'package:flutter/src/gestures/tap.dart': Failed assertion: line 210 pos 14: '_down == null && _up == null': is not true.

======== Exception caught by gesture library =======================================================
The following assertion was thrown while dispatching a pointer event:
'package:flutter/src/gestures/tap.dart': Failed assertion: line 210 pos 14: '_down == null && _up == null': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack: 
#2      BaseTapGestureRecognizer.addAllowedPointer (package:flutter/src/gestures/tap.dart:210:14)
#3      GestureRecognizer.addPointer (package:flutter/src/gestures/recognizer.dart:160:7)
#4      RawGestureDetectorState._handlePointerDown (package:flutter/src/widgets/gesture_detector.dart:1498:18)
#5      RenderPointerListener.handleEvent (package:flutter/src/rendering/proxy_box.dart:3168:29)
#6      GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
#7      RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:336:11)
#8      GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
#9      GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
#10     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
#11     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
#12     _invoke1 (dart:ui/hooks.dart:164:13)
#13     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:361:7)
#14     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)
(elided 2 frames from class _AssertionError)
Event: PointerDownEvent#85236(position: Offset(222.0, 753.2))
  position: Offset(222.0, 753.2)
Target: RenderPointerListener#00676 relayoutBoundary=up8
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=819.4)
  size: Size(411.4, 819.4)
  behavior: deferToChild
  listeners: down, panZoomStart

Is there a way to make this work?

Alternatively, is there a way to listen for user initiated zooms, pans, and rotates with this package?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,按照报告中所示的手势回调,在 Stack 中的 map 上使用 transparent_pointer 重现该 assertion。阅读 tap.dart、gesture_detector.dart 周围的 Flutter 手势栈,以及 map package 的手势入口点;当该交互不再触发 assertion,并且能够区分或记录用户发起的 pan、zoom 和 rotate 手势时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
dart, flutter
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。