class UserModel { final int? id; final String? customerId; final String? customerName; final String? email; UserModel({this.id, this.customerId, this.customerName, this.email}); factory UserModel.fromJson(Map json) { return UserModel( id: json['id'], customerId: json['customer_id'] ?? json['customerId'], customerName: json['customer_name'] ?? json['name'], email: json['email'], ); } Map toJson() => { 'id': id, 'customer_id': customerId, 'customer_name': customerName, 'email': email, }; }