class Word { final String topic; final String polish; final String german; Word({ required this.topic, required this.polish, required this.german, }); Map toMap() { return { 'topic': topic, 'polish': polish, 'german': german, }; } factory Word.fromMap({required Map map}) { return Word( topic: map['topic'], polish: map['polish'], german: map['german'], ); } }