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