Flutter google maps , how to make a gradient in polylines?

Viewed 733

Is there any way to make the polylines a gradient, and not just the same color?

That code is working well = polylines created but i can't add gradient //Create polylines

  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),
      ),
    );
  }
1 Answers

If you are using google_maps_flutter package, it seems that the feature to add a gradient polyline is not yet available for this package as there's an existing feature request to support gradient colors to polyline/plolygons.

However, if you are using flutter_map package, perhaps you can try this.

Related