You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haved Human as superclass and Student as subclass and defined Student as explicitSubTypes to Human morphy annotation options with generateJson to true but getting error for _$StudentFromJson
The method '_$StudentFromJson' isn't defined for the type 'Human'.Try correcting the name to the name of an existing method, or defining a method named '_$StudentFromJson'.dart[undefined_method](https://dart.dev/diagnostics/undefined_method)
after cloning the repo and running the 9 Change To test in example/readme_test.dart your test passes while i have done the same thing the difference is you defined both Pet = superclass, Cat = subclass in same file at readme_test.dart while i defined each class in its own file may be this causing issue and we are not importing subclass.g.dart file in our superclass.morphy.dart
Hi @burhankhanzada thanks for trying out Morphy. Yes, if you use the explicitSubtypes, then you must create the classes in the same file. Would that fix the problem for you?
I would like to at some point look at a way of getting it to work without that. I'll update the readme, it does say same file somewhere in there but it should be more obvious.
Perhaps I should run a check and show a warning at least when we build our code.
I haved
Human
as superclass andStudent
as subclass and defined Student as explicitSubTypes toHuman
morphy annotation options with generateJson to true but getting error for_$StudentFromJson
The text was updated successfully, but these errors were encountered: