color property

Color color
final

Specifies the color applies to the shape or bubble based on the value.

List<Model> data;

 @override
 void initState() {
   super.initState();

   data = <Model>[
    Model('India', 280, "Low"),
    Model('United States of America', 190, "High"),
    Model('Pakistan', 37, "Low"),
   ];
 }

 @override
 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
       MapShapeLayer(
         delegate: MapShapeLayerDelegate(
             shapeFile: "assets/world_map.json",
             shapeDataField: "name",
             dataCount: data.length,
             primaryValueMapper: (index) {
               return data[index].country;
             },
             shapeColorValueMapper: (index) {
               return data[index].storage;
             },
             shapeColorMappers: [
               MapColorMapper(value: "Low", color: Colors.red),
               MapColorMapper(value: "High", color: Colors.green)
             ]),
       )
     ],
   );
 }

See also:

Implementation

final Color color