Closed Dinesh2411 closed 1 year ago
Hi guys I have the dart_json_mapper: ^2.2.4+2 installed in my flutter project.
Everything is working fine, but while deserializing an enum from one of my classes it's showing an error.
Visitor Model Class
@jsonSerializable class Visitor { @JsonProperty(name: 'Gender') GenderEnum gender = GenderEnum.NA; }
Gender Enum `import 'package:dart_json_mapper/dart_json_mapper.dart';
@jsonSerializable enum GenderEnum { Male, Female, NA }`
The error
I/flutter ( 2177): ErrorInstance of 'DeserializationContext' I/flutter ( 2177): FormatException: Unexpected character (at character 1) I/flutter ( 2177): NA I/flutter ( 2177): ^
Note:
I have followed the documentation https://pub.dev/packages/dart_json_mapper/example But still, no success don't know what step I am missing
Can you share the actual code which is failing? Including JSON text? Ideally the simple reproduction excerpt
Hi guys I have the dart_json_mapper: ^2.2.4+2 installed in my flutter project.
Everything is working fine, but while deserializing an enum from one of my classes it's showing an error.
Visitor Model Class
@jsonSerializable class Visitor { @JsonProperty(name: 'Gender') GenderEnum gender = GenderEnum.NA; }
Gender Enum `import 'package:dart_json_mapper/dart_json_mapper.dart';
@jsonSerializable enum GenderEnum { Male, Female, NA }`
The error
I/flutter ( 2177): ErrorInstance of 'DeserializationContext' I/flutter ( 2177): FormatException: Unexpected character (at character 1) I/flutter ( 2177): NA I/flutter ( 2177): ^
Note:
I have followed the documentation https://pub.dev/packages/dart_json_mapper/example But still, no success don't know what step I am missing