Application/medcify/lib/models/api/banner_response.dart
2022-09-26 12:03:52 +05:30

19 lines
513 B
Dart

import 'package:medcify/models/banner_item.dart';
class BannerResponse{
bool? status;
String? message;
List<BannerItem>? banners;
BannerResponse.fromJson(Map<String, dynamic> json){
status = (json["Code"] ?? "0") != "0";
banners = (json["Data"] != null) ? json["Data"].map<BannerItem>((e) => BannerItem.fromJson(e)).toList() : [];
message = json["Message"] ?? "Something went wrong";
}
BannerResponse.withError(String err){
status = false;
banners = [];
message = err;
}
}