from property

double? from

Sets the range start for the color mapping.

The shape or bubble will render in the specified color if the value returned in the MapShapeSource.shapeColorValueMapper or MapShapeSource.bubbleColorValueMapper falls between the from and to range.

late List<Model> _data;
late MapShapeSource _mapSource;

 void initState() {

   _data = <Model>[
    Model('India', 100, "Low"),
    Model('United States of America', 200, "High"),
    Model('Pakistan', 75, "Low"),

   _mapSource = MapShapeSource.asset(
     shapeDataField: "name",
     dataCount: _data.length,
     primaryValueMapper: (int index) {
       return _data[index].country;
     shapeColorValueMapper: (int index) {
        return _data[index].count;
     shapeColorMappers: [
        MapColorMapper(from: 0, to:  100, color:,
        MapColorMapper(from: 101, to: 200, color: Colors.yellow)

 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
         source: _mapSource,

class Model {
 const Model(, this.count,;

 final String country;
 final double count;
 final String storage;

See also:


final double? from;