Map<String, dynamic> toJson() => painter != null ? painter!.toJson() : { 'source': {'imageUri': imageUri} };