We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
part 'device.jser.dart'; class Device { String uuid; //Name of the device String name; Device({@required this.uuid, this.name}); Map<String, dynamic> toJson() => serializer.toMap(this); static final serializer = DeviceSerializer(); static Device fromMap(Map map) => serializer.fromMap(map); String toString() => toJson().toString(); } @GenSerializer() class DeviceSerializer extends Serializer<Device> with _$DeviceSerializer {}
generated file is:
part of 'device.dart'; // ************************************************************************** // JaguarSerializerGenerator // ************************************************************************** abstract class _$DeviceSerializer implements Serializer<Device> { @override Map<String, dynamic> toMap(Device model) { if (model == null) return null; Map<String, dynamic> ret = <String, dynamic>{}; setMapValue(ret, 'uuid', model.uuid); setMapValue(ret, 'name', model.name); return ret; } @override Device fromMap(Map map) { if (map == null) return null; final obj = new Device(); //it should be final obj = new Device(uuid:''); obj.uuid = map['uuid'] as String; obj.name = map['name'] as String; return obj; } }
The text was updated successfully, but these errors were encountered:
Wrong repo, should be under jaguar_serializer I guess :)
Sorry, something went wrong.
@noisytempo I will fix this.
No branches or pull requests
generated file is:
The text was updated successfully, but these errors were encountered: