I'm trying to use jaguar_serializer to convert my json string to its corresponding model object. I followed the steps as described in https://github.com/Jaguar-dart/jaguar_serializer. However, I keep getting this error when I run 'serializer build':
'package:jaguar_generator_config/src/generator.dart': error: line 17: illegal implicit access to receiver 'this' _config = loadYaml(new File(configFileName).readAsStringSync());
Here is my user.dart model:
library models.user;
import 'package:jaguar_serializer/serializer.dart';
part 'user.g.dart';
@GenSerializer()
class UserJsonSerializer extends Serializer<User> with _$UserJsonSerializer {
User createModel() => new User();
}
/// User model
class User {
String name;
int age;
}
And here is my serializer.yaml file:
serializers:
# Add files with your serializable class here.
- lib/models/user.dart
The library version of the serializer is
jaguar_serializer: ^0.3.0