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

20 lines
553 B
Dart
Raw Normal View History

2022-09-26 06:33:52 +00:00
import 'package:medcify/models/banner_item.dart';
import 'package:medcify/models/order_item.dart';
class OrderResponse{
bool? status;
String? message;
List<OrderItem>? orders;
OrderResponse.fromJson(Map<String, dynamic> json){
status = (json["Code"] ?? "0") != "0";
orders = (json["Data"] != null) ? json["Data"].map<OrderItem>((e) => OrderItem.fromJson(e)).toList() : [];
message = json["Message"] ?? "Something went wrong";
}
OrderResponse.withError(String err){
status = false;
orders = [];
message = err;
}
}