import 'package:json_annotation/json_annotation.dart'; part 'classes.g.dart'; @JsonSerializable() class SearchResponse { final int id; final String key; final String title; final String excerpt; final String description; const SearchResponse( this.id, this.key, this.title, this.excerpt, this.description); /// Connect the generated function to the `fromJson` /// factory. factory SearchResponse.fromJson(Map json) => _$SearchResponseFromJson(json); /// Connect the generated function to the `toJson` method. Map toJson() => _$SearchResponseToJson(this); }