CarrouselImagesModel.fromJson constructor

CarrouselImagesModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CarrouselImagesModel.fromJson(Map<String, dynamic> json) {
  String imgKey = json.keys.firstWhere((key) => key.startsWith('img'));
  String urlImgKey = json.keys.firstWhere((key) => key.startsWith('url_img'));

  return CarrouselImagesModel(
    img: json[imgKey] as String,
    urlImg: json[urlImgKey] as String,
  );
}