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 really like the factory constructor syntax from json_serializable, to be able to call Model.fromJson(uint8List).
I'm aware this would just be syntactic-sugar with out much value, but could help migrating from json_serializable to crimson, and it could be just optionally.
Example what I mean
If there is a factory constructor that returns _$<className>(buffer) (or some other name convention)
finalModel model =Model.fromJson(singleModelUint8List);
finalUint8List foo = model.toJson();
finalList<Model> list =ModelList.fromJson(listUint8List);
finalUint8List bar = list.toJson();
If this is something you want I can create a PR.
The text was updated successfully, but these errors were encountered:
@simc After working on it for a while now, the only way to make it work (together with freezed) is to always use @Freezed(fromJson: false, toJson: false)
I really like the factory constructor syntax from json_serializable, to be able to call
Model.fromJson(uint8List)
.I'm aware this would just be syntactic-sugar with out much value, but could help migrating from json_serializable to crimson, and it could be just optionally.
Example what I mean
If there is a factory constructor that returns
_$<className>(buffer)
(or some other name convention)then generate additional extensions like so:
then you can call
If this is something you want I can create a PR.
The text was updated successfully, but these errors were encountered: