20 lines
553 B
Dart
20 lines
553 B
Dart
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;
|
|
}
|
|
} |