google-maps - flutter 谷歌地图,如何在折线中制作渐变?

标签 google-maps flutter dart linear-gradients

有什么方法可以使多段线成为渐变,而不仅仅是相同的颜色?

该代码运行良好=创建了折线,但我无法添加渐变
//创建折线

  void _setPolylLines() {
    _polylines.add(
      Polyline(
        polylineId: PolylineId("polylineHistoryRoute"),
        points: polyLinesLatLongs,
        width: 4,
        patterns: <PatternItem>[PatternItem.dash(25), PatternItem.gap(15)],
        color: Color.fromRGBO(86, 168, 235, 1),
      ),
    );
  }

最佳答案

如果您使用 google_maps_flutter包中,添加渐变折线的功能似乎尚不适用于此包,因为现有 feature request支持渐变颜色到折线/多边形。
但是,如果您使用 flutter_map包,或许你可以试试this .

关于google-maps - flutter 谷歌地图,如何在折线中制作渐变?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62260509/

相关文章:

git - 运行 Android Studio 模拟器时出现问题 : git set up launches and tries to downgrade

sqlite - 使用sqlite、flutter app导入数据库

scope - 使用 Dart 的 final 关键字确定范围

ios - 如何在 ios 中使用谷歌地图实现位置搜索?

javascript - 谷歌地图 map.getBounds() 在调用 map.fitBounds 后立即

google-maps - 谷歌地图 API v3 : Does placemarker exist on given LatLng?

dart - 如何使用Future方法,但Dart grpc客户端在调用future方法后未提供未知服务

javascript - 在 FormView 的 Edittemplate 中显示 Google map 时遇到问题

flutter - 在 flutter 中对视频应用过滤器

android - 您如何在小部件中定义来自 future 的变量?