Google Maps Flutter无法在Android设备上点击MAP工具栏,但是我可以在模拟器上点击地图工具栏吗?

发布于 2025-01-21 05:23:07 字数 585 浏览 3 评论 0原文

我正在使用Pub.dev中的Google_maps_flutter进行flutter应用程序。

我遇到了一个问题,当我单击标记时,地图工具栏可根据屏幕的右角滑入,但我无法点击地图工具栏按钮。当我点击它时,工具栏只是退出视图。我也无法点击放大和缩放按​​钮。如果重要的是,我可以点击指南针按钮。

奇怪的是,我只有在使用真实设备时才有这个问题。如果我使用仿真器,我可以利用MAP工具栏按钮,将我带到Google Map并放大并放大按钮。

我不确定发生了什么,谷歌搜索使我无处不在。

我已经尝试了以下操作,

从堆栈中删除Google Map小部件,

我试图添加这样的孕妇,

gestureRecognizers: <Factory<OneSequenceGestureRecognize>> [
    new Factory <OneSequenceGestureRecognizer> (
        () => new EagerGestureRecognizer(),
    ),
].toSet()

如果您不介意将我指向正确的方向解决此问题,我将不胜感激!

I'm using google_maps_flutter from pub.dev for my flutter application.

I'm having an issue where when I click a marker, the map toolbar slides in from the right hand corner of the screen as it should, but I cannot tap on the map toolbar buttons. The toolbar just slides back out of view when I tap it. I also am not able to tap on the zoom in and zoom out buttons. I am able to tap on the compass button just in case that matters.

The weird thing is that I only have this problem when I'm using a real device. If I use an emulator, I am able to tap on the map toolbar buttons which brings me to Google Maps and the zoom in and zoom out buttons.

I'm not sure what is going on and googling has led me nowhere.

I have already tried the following,

Remove the Google Map widget from a Stack,

I've tried to add the gestureRecognizers like this,

gestureRecognizers: <Factory<OneSequenceGestureRecognize>> [
    new Factory <OneSequenceGestureRecognizer> (
        () => new EagerGestureRecognizer(),
    ),
].toSet()

If you don't mind pointing me in the right direction to solve this issue, I'd appreciate it!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

誰認得朕 2025-01-28 05:23:07

尝试这个手势

  gestureRecognizers: Set()
                        ..add(Factory<PanGestureRecognizer>(
                            () => PanGestureRecognizer()))
                        ..add(Factory<ScaleGestureRecognizer>(
                            () => ScaleGestureRecognizer()))
                        ..add(Factory<TapGestureRecognizer>(
                            () => TapGestureRecognizer()))
                        ..add(Factory<VerticalDragGestureRecognizer>(
                            () => VerticalDragGestureRecognizer())),

Try this gestures

  gestureRecognizers: Set()
                        ..add(Factory<PanGestureRecognizer>(
                            () => PanGestureRecognizer()))
                        ..add(Factory<ScaleGestureRecognizer>(
                            () => ScaleGestureRecognizer()))
                        ..add(Factory<TapGestureRecognizer>(
                            () => TapGestureRecognizer()))
                        ..add(Factory<VerticalDragGestureRecognizer>(
                            () => VerticalDragGestureRecognizer())),
臻嫒无言 2025-01-28 05:23:07

我面对这个问题,事实证明这是因为通过Gorouter创建的覆盖层和使用ResponsiveWarpper。

builder: (context, _) {
        var child = _!;
        child = Toast(navigatorKey: rootNavigatorKey, child: child);
        return ResponsiveWrapper.builder(
            ClampingScrollWrapper.builder(context, child),
            breakpointsLandscape: breakpointsLandscape,
            breakpoints: breakpoints,
            defaultName: MOBILE,
            defaultScale: true,
            minWidth: 360,
            defaultScaleFactor: 0.88);
        }

为了解决它,我最终删除了响应式包装器。

      builder: (context, child) {
        return child == null? Container() : Toast(navigatorKey: rootNavigatorKey, child: child,);
      },

I faced this issue, and it turned out it was because of an overlay created via GoRouter and the use of the ResponsiveWarpper.

builder: (context, _) {
        var child = _!;
        child = Toast(navigatorKey: rootNavigatorKey, child: child);
        return ResponsiveWrapper.builder(
            ClampingScrollWrapper.builder(context, child),
            breakpointsLandscape: breakpointsLandscape,
            breakpoints: breakpoints,
            defaultName: MOBILE,
            defaultScale: true,
            minWidth: 360,
            defaultScaleFactor: 0.88);
        }

To resolve it, I ended up with removing the responsive wrapper.

      builder: (context, child) {
        return child == null? Container() : Toast(navigatorKey: rootNavigatorKey, child: child,);
      },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文