Skip to content

Commit

Permalink
also use json_serializable for ExternalIds (was forgotten in #ac354cb)
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzSchueler committed Nov 17, 2023
1 parent cc49daa commit cd0b06d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/models/suggestion_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Suggestion {
Map<String, dynamic> toJson() => _$SuggestionToJson(this);
}

@JsonSerializable()
class ExternalIds {
ExternalIds({
this.foursquare,
Expand All @@ -72,13 +73,8 @@ class ExternalIds {
final String? foursquare;
final String? safegraph;

factory ExternalIds.fromJson(Map<String, dynamic> json) => ExternalIds(
foursquare: json["foursquare"],
safegraph: json["safegraph"],
);
factory ExternalIds.fromJson(Map<String, dynamic> json) =>
_$ExternalIdsFromJson(json);

Map<String, dynamic> toJson() => {
"foursquare": foursquare,
"safegraph": safegraph,
};
Map<String, dynamic> toJson() => _$ExternalIdsToJson(this);
}
11 changes: 11 additions & 0 deletions lib/models/suggestion_response.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd0b06d

Please sign in to comment.