1
我正嘗試使用jaguar_serializer將我的json字符串轉換爲其對應的模型對象。我按照https://github.com/Jaguar-dart/jaguar_serializer中所述的步驟執行。在jaguar_serializer中運行'serializer build'時出現錯誤
'套餐:jaguar_generator_config/src目錄/ generator.dart':錯誤:第17行:到接收器 '這個' _config = loadYaml非法隱式訪問(但是,當我運行 '串構建' 我不斷收到此錯誤新的文件(configFileName).readAsStringSync());
這裏是我的user.dart型號:
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;
}
這裏是我的serializer.yaml文件:
serializers:
# Add files with your serializable class here.
- lib/models/user.dart
串行的庫版本是
jaguar_serializer: ^0.3.0