【问题标题】:How can I connect ListView to Google Map. I would like to select a location then change the map polylines and cameraposition如何将 ListView 连接到 Google Map。我想选择一个位置,然后更改地图折线和相机位置
【发布时间】:2021-01-25 01:33:04
【问题描述】:

小部件构建(BuildContext 上下文){ 返回脚手架( 应用栏:应用栏( 标题:文本('选择路线'), ), 正文:列表视图( 孩子们: [ 列表瓦片( 领先:图标(Icons.map), 标题:文本('起源:Calinan'), subtitle: Text('Destination: Roxas'), 尾随:图标按钮( 图标:图标(Icons.arrow_forward), 按下:(){ 导航器.push(上下文, MaterialPageRoute(builder: (context) => Map()));

              })),
      ListTile(
          leading: Icon(Icons.map),
          title: Text('Map'),
          trailing: IconButton(
              icon: Icon(Icons.arrow_forward),
              onPressed: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (context) => Map()));
              })),
      ListTile(
          leading: Icon(Icons.map),
          title: Text('Map'),
          trailing: IconButton(
              icon: Icon(Icons.arrow_forward),
              onPressed: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (context) => Map()));
              })),
    ],
  ),
);

}

【问题讨论】:

    标签: google-maps flutter


    【解决方案1】:

    虽然 ListView 是一种以有序方式显示小部件的好方法,as this answer says,但您不想在 ListView 中使用 Google 地图。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-12
      • 2021-09-17
      • 1970-01-01
      • 1970-01-01
      • 2011-10-18
      • 2014-09-16
      • 1970-01-01
      • 2015-06-06
      相关资源
      最近更新 更多