class Student { final String studentNFCCardId; final String firstName; final String name; final String promotion; final String studentId; Student({ required this.studentNFCCardId, required this.firstName, required this.name, required this.promotion, required this.studentId }); Map toMap() { return { 'studentNFCCardId': studentNFCCardId, 'firstName': firstName, 'name': name, 'promotion': promotion, 'studentId': studentId }; } factory Student.fromMap(Map map) { return Student( studentNFCCardId: map['studentNFCCardId'], firstName: map['firstName'], name: map['name'], promotion: map['promotion'], studentId: map['studentId'] ); } }