shapeColorValueMapper property

IndexedColorValueMapper shapeColorValueMapper
final

Returns a color or value based on which shape color will be updated.

If this returns a color, then this color will be applied to the shape straightaway.

If it returns a value other than the color, then you must set the MapShapeLayerDelegate.shapeColorMappers property.

The value returned from the shapeColorValueMapper will be used for the comparison in the MapColorMapper.value or MapColorMapper.from and MapColorMapper.to. Then, the MapColorMapper.color will be applied to the respective shape.

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

Implementation

final IndexedColorValueMapper shapeColorValueMapper