strokeCap property

StrokeCap strokeCap

Applies stroke cap to the start and end of all polylines. You can set StrokeCap.round to get a semi-circle or StrokeCap.square to get a semi-square at the edges of the polyline.

The default value is StrokeCap.butt which doesn't apply any cap at the ends.

See also:

 late List<MapLatLng> _polyLines;
 late MapShapeSource _mapSource;

  void initState() {
    _polyLines = <MapLatLng>[
      MapLatLng(13.0827, 80.2707),
      MapLatLng(14.4673, 78.8242),
      MapLatLng(14.9091, 78.0092),
      MapLatLng(16.2160, 77.3566),
      MapLatLng(17.1557, 76.8697),
      MapLatLng(18.0975, 75.4249),
      MapLatLng(18.5204, 73.8567),
      MapLatLng(19.0760, 72.8777),

    _mapSource = MapShapeSource.asset(
      shapeDataField: 'name',


  Widget build(BuildContext context) {
    return Scaffold(
      body: SfMaps(
        layers: [
            source: _mapSource,
            sublayers: [
                polylines: List<MapPolyline>.generate(
                  (int index) {
                    return MapPolyline(
                      points: _polyLines,
                strokeCap: StrokeCap.round,

See also:


final StrokeCap strokeCap;