showIcon property

bool showIcon
final

Shows or hides the legend icons.

Defaults to true.

 @override
 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
       MapShapeLayer(
         showLegend: true,
         legendSettings: MapLegendSettings(
             showIcon: true
         ),
         delegate: MapShapeLayerDelegate(
             shapeFile: "assets/world_map.json",
             shapeDataField: "continent",
             dataCount: bubbleData.length,
             primaryValueMapper: (index) {
               return bubbleData[index].country;
             }),
       )
     ],
   );
 }

See also:

  • iconType, to set the icon type for the legend items.
  • iconSize, to set size of the icons.

Implementation

final bool showIcon