toMap method

Map<String, Object?> toMap()

Implementation

Map<String, Object?> toMap() => <String, Object?>{
  'id': id,
  'name': name,
  if (description != null) 'description': description,
  if (imageUrl != null) 'imageUrl': imageUrl,
  if (actionUrl != null) 'actionUrl': actionUrl,
  if (createdAt != null) 'createdAt': createdAt,
  if (materialId != null) 'materialId': materialId,
  if (trait != null && !trait!.isEmpty) 'trait': trait!.toMap(),
};