taafee-mobile/lib/features/card/data_layer/model/card_images.dart
2023-10-17 17:22:55 +03:00

29 lines
562 B
Dart

class CardImages {
int id;
String url;
int cardId;
CardImages({
required this.id,
required this.url,
required this.cardId,
});
factory CardImages.fromJson(Map<String, dynamic> json) => CardImages(
id: json["id"],
url: json["url"],
cardId: json["card_id"],
);
static List<CardImages> fromJsonList(Map<String, dynamic> json) {
List<CardImages> images = [];
json["card_images"].forEach(
(element) => images.add(
CardImages.fromJson(element),
),
);
return images;
}
}