serializers.dart
。如何实际构建项目以生成serializers.g.dart
文件?
由于
答案 0 :(得分:5)
在最近的版本中,您需要@SerializersFor()
注释
另请参见示例项目https://github.com/google/built_value.dart/blob/master/chat_example/lib/data_model/serializers.dart
library serializers;
import 'package:built_collection/built_collection.dart';
import 'package:built_value/serializer.dart';
import 'package:chat_example/data_model/data_model.dart';
part 'serializers.g.dart';
/// Collection of generated serializers for the built_value chat example.
@SerializersFor(const [
Chat,
ListUsers,
ListUsersResponse,
Login,
LoginResponse,
ShowChat,
Status,
Welcome,
])
final Serializers serializers = _$serializers;