import 'base.dart'; class Lookup extends Base { int? id; // Now nullable int? value; // Now nullable @override String? name; // Now nullable Lookup({this.id, this.value, this.name}) : super(identifier: id?.toString(), name: name); @override bool operator ==(Object other) => identical(this, other) || other is Lookup && ((value != null && value == other.value) || (id != null && id == other.id)); @override int get hashCode => id.hashCode ^ value.hashCode; // Use XOR for hash code combination Map toJson() { // Return a Map instead of calling a function return {"id": id, "name": name, "value": value}; } static Lookup? fromStatus(Lookup? old) { // Now accepts nullable Lookup and returns nullable Lookup if (old == null) return null; return Lookup( name: old.name, id: old.id, value: old.value, ); } // CreatedBy.fromJson(dynamic json) { // userId = json['userId'] ?? ''; // userName = json['userName'] ?? ''; // } factory Lookup.fromJson(Map parsedJson) { // if (parsedJson == null) return null; return Lookup( name: parsedJson["name"], id: parsedJson["id"], value: parsedJson["value"], ); } }