toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    if (color != null) 'color': color!.toJson(),
    if (pattern != null) 'pattern': pattern,
  };
}