toJson method
Implementation
Map<String, dynamic> toJson() => {
if (semanticLabel != null) 'semanticLabel': semanticLabel,
if (gradient != null) 'gradient': gradient!.toJson(),
if (backgroundImage != null) 'backgroundImage': backgroundImage,
};