toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    colorName: this['$colorName.500'],
    '$colorName.50': this['$colorName.50'],
    "$colorName.100": this['$colorName.100'],
    "$colorName.200": this['$colorName.200'],
    "$colorName.300": this['$colorName.300'],
    "$colorName.400": this['$colorName.400'],
    "$colorName.500": this['$colorName.500'],
    "$colorName.600": this['$colorName.600'],
    "$colorName.700": this['$colorName.700'],
    "$colorName.800": this['$colorName.800'],
    "$colorName.900": this['$colorName.900'],
  };
}