-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
FromJson(json) #7
Comments
These are my models @immutable
abstract class Planets with _$Planets {
factory Planets(List<Planet> results) = _Planets;
factory Planets.fromJson(Map<String, dynamic> json) =>
_$PlanetsFromJson(json);
}
@immutable
abstract class Planet with _$Planet {
factory Planet(String name) = _Planet;
factory Planet.fromJson(Map<String, dynamic> json) => _$PlanetFromJson(json);
}
|
Ah, that I'll update the code to work without it for classes with a single constructor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Remi,
great work, again :)
FromJson(json) will generate code that requires a property called runtimeType in my map.
Am i supposed to add runtimeType to every Map ?
Imagine the following response:
2 Maps, 2 Models.
The text was updated successfully, but these errors were encountered: