首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何添加自定义信息窗口颤动

如何添加自定义信息窗口颤动
EN

Stack Overflow用户
提问于 2021-04-02 23:37:56
回答 2查看 3.3K关注 0票数 3

我想将此自定义小部件添加到我的标记中。我已经设计了小工具,但我不知道如何在标记上定位它。

如何将其自定义为始终显示在信息窗口位置。它被包装在一个定位的小部件中,但我无法将它放在信息窗口的位置。

代码语言:javascript
运行
复制
Stack(
        children: [
          AnimatedPositioned(
            bottom: 0.0,
            duration: Duration(milliseconds: 200),
            child: Container(
              padding: EdgeInsets.only(top:
              30,left: 15,
                  right: 15,bottom: 10),
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.only(
                      topRight: Radius.circular(0),
                      topLeft: Radius.circular(0),
                      bottomRight: Radius.circular(5),
                      bottomLeft: Radius.circular(5))),
              child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  Text(
                    '500 USD',
                    style: TextStyle(
                      fontWeight: FontWeight.w600,
                      fontFamily: 'Roboto',
                      color: customBlue,
                      fontSize: _sizeConfig.textSize(
                        context,
                        Converters.configSize(14),
                      ),
                    ),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  RatingBar.builder(
                    initialRating: 3.5,
                    unratedColor: Colors.grey
                        .withOpacity(0.5),
                    minRating: 1,
                    allowHalfRating: true,
                    itemSize: 20,
                    direction: Axis.horizontal,
                    itemCount: 5,
                    itemPadding: EdgeInsets.symmetric(horizontal: 0.0),
                    itemBuilder: (context, _) => Icon(
                      Icons.star,
                      color: customRed,
                    ),
                  ),
                ],
              ),
              width: 163,
            ),
          )
        ],
      ),
EN

回答 2

Stack Overflow用户

发布于 2021-04-17 02:10:31

请尝试custom_info_window。这是一个软件包,允许基于窗口小部件的自定义信息窗口的google_maps_flutter。通过使用此功能,您将能够移动您的小部件,如地图标记顶部的信息窗口。

票数 1
EN

Stack Overflow用户

发布于 2021-04-04 18:04:47

在google地图插件中,没有简单的apis可以将您的小部件用作标记。

但也有一些技巧。您应该将小部件导出到图像,并通过BitmapDescriptor.fromBytes传递它。

如何做的有用链接:

Widget to Image

Pass widget converted to Image to Google map

如果它看起来像样板代码,您可以使用flutter_map插件by leaflet

flutter_map

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66921735

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档