toJson method Null safety

Map<String, dynamic> toJson()

Implementation

core.Map<core.String, core.dynamic> toJson() => {
      if (blue != null) 'blue': blue!,
      if (green != null) 'green': green!,
      if (red != null) 'red': red!,
    };