Files
kent_logistics_app/lib/models/user_model.dart
2025-11-28 10:14:30 +05:30

25 lines
596 B
Dart

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<String, dynamic> json) {
return UserModel(
id: json['id'],
customerId: json['customer_id'] ?? json['customerId'],
customerName: json['customer_name'] ?? json['name'],
email: json['email'],
);
}
Map<String, dynamic> toJson() => {
'id': id,
'customer_id': customerId,
'customer_name': customerName,
'email': email,
};
}