19 lines
513 B
Dart
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;
|
||
|
}
|
||
|
}
|