New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Map type #97
Comments
Thanks for replying @iamarnas. {
"__className": "Topic",
"id": "sport",
"is_stored": true,
"name": "Sport",
"articles.Map": {}
} My expected output will be import 'package:freezed_annotation/freezed_annotation.dart';
part 'topic.freezed.dart';
part 'topic.g.dart';
@freezed
class Topic with _$Topic {
factory Topic({
String? id,
String? name,
@JsonKey(name: 'is_stored') bool? isStored,
Map articles,
}) = _Topic;
factory Topic.fromJson(Map<String, dynamic> json) => _$TopicFromJson(json);
}
And the Map type should be Map class of Dart. |
@princ3od In this way |
I tried it and it did not work. So how can I generate a class with a |
If it doesn't work then it's not allowed. |
also looking for this. would be helpful for Firestore conversions. |
It would be great if
Json-to-Dart-Model
supported Map data type as it already supported List.Currrently, if the key is something like
"key.Map":{}
, it creates a whole new class called Map. I think it should use the existed Map class of Dart.Thank you.
The text was updated successfully, but these errors were encountered: