import 'FileModel.dart'; class users { int? id; String? username; String? email; String? name; String? gender; String? phoneNumber; String? country; String? city; String? provider; bool? active; String? address; bool? deleted; String? role; FileModel? image; bool? notificationFcm; bool? notificationEmail; int? timestamp; users({ this.id, this.username, this.email, this.name, this.gender, this.phoneNumber, this.country, this.city, this.provider, this.active, this.address, this.deleted, this.role, this.image, this.notificationFcm, this.notificationEmail, this.timestamp, }); factory users.fromJson(Map json) { return users( id: json['id'], username: json['username'], email: json['email'], name: json['name'], gender: json['gender'], phoneNumber: json['phonenumber'], country: json['country'], city: json['city'], provider: json['provider'], active: json['active'], address: json['address'], deleted: json['deleted'], role: json['role'], image: json['image'] != null ? FileModel.fromJson(json['image']) : null, notificationFcm: json['notificationfcm'], notificationEmail: json['notificationemail'], timestamp: json['timestmp'], ); } Map toJson() { return { 'id': id, 'username': username, 'email': email, 'name': name, 'gender': gender, 'phonenumber': phoneNumber, 'country': country, 'city': city, 'provider': provider, 'active': active, 'address': address, 'deleted': deleted, 'role': role, 'notificationfcm': notificationFcm, 'notificationemail': notificationEmail, 'timestmp': timestamp, }; } // Override equality operator @override bool operator ==(Object other) { if (identical(this, other)) return true; return other is users && other.id == id; // Compare based on id or another unique property } // Override hashCode @override int get hashCode => id.hashCode; }