【发布时间】:2021-06-29 11:14:16
【问题描述】:
我想将此自定义小部件添加到我的标记中。我已经设计了小部件,但我不知道如何将它定位在标记上。
如何自定义它以始终显示在信息窗口位置。它包含在定位的小部件中,但我无法将其放置在信息窗口位置。
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,
),
)
],
),
【问题讨论】:
-
你用什么地图?请提及
-
谷歌地图兄弟,
-
不幸的是,没有简单的方法来实现它,但是有一个完整的教程,包括创建image from a widget 并将其用作标记的图标。看看:medium.com/swlh/…
-
您是否找到需要与我的应用程序具有相同功能的解决方案。 @customapps
标签: flutter google-maps dart