import 'dart:convert'; class PaymentMethodsResponseModel { final String? status; final List? data; PaymentMethodsResponseModel({ this.status, this.data, }); factory PaymentMethodsResponseModel.fromJson(String str) => PaymentMethodsResponseModel.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory PaymentMethodsResponseModel.fromMap(Map json) => PaymentMethodsResponseModel( status: json["status"], data: json["data"] == null ? [] : List.from( json["data"]!.map((x) => PaymentMethod.fromMap(x))), ); Map toMap() => { "status": status, "data": data == null ? [] : List.from(data!.map((x) => x.toMap())), }; } class PaymentMethod { final int? id; final String? name; final String? description; final bool? isActive; final int? sortOrder; final DateTime? createdAt; final DateTime? updatedAt; PaymentMethod({ this.id, this.name, this.description, this.isActive, this.sortOrder, this.createdAt, this.updatedAt, }); factory PaymentMethod.fromJson(String str) => PaymentMethod.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory PaymentMethod.fromMap(Map json) => PaymentMethod( id: json["id"], name: json["name"], description: json["description"], isActive: json["is_active"], sortOrder: json["sort_order"], createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]), updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]), ); Map toMap() => { "id": id, "name": name, "description": description, "is_active": isActive, "sort_order": sortOrder, "created_at": createdAt?.toIso8601String(), "updated_at": updatedAt?.toIso8601String(), }; }