Application/medcify/lib/models/api/banner_response.dart

19 lines
513 B
Dart
Raw Normal View History

2022-09-26 06:33:52 +00:00
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;
}
}