class Contact { int? id; String name; String? phone; String? email; String? address; String? company; String? notes; Contact({ this.id, required this.name, this.phone, this.email, this.address, this.company, this.notes, }); Map toMap() { return { 'id': id, 'name': name, 'phone': phone, 'email': email, 'address': address, 'company': company, 'notes': notes, }; } factory Contact.fromMap(Map map) { return Contact( id: map['id'], name: map['name'], phone: map['phone'], email: map['email'], address: map['address'], company: map['company'], notes: map['notes'], ); } @override String toString() { return 'Contact{id: $id, name: $name, phone: $phone, email: $email, address: $address, company: $company, notes: $notes}'; } }