I'm trying using built_value in flutter, and found if I declared a Type use built_value, I can commonly use dot syntax to assign value to it's properties: my declaration is:
abstract class Post implements Built<Post, PostBuilder> {
Post._();
int get userId;
int get id;
String get title;
String get body;
factory Post([updates(PostBuilder b)]) = _$Post;
static Serializer<Post> get serializer => _$postSerializer;
}
and use it like this:
Post p = Post();
p.titie = "hello world";
got error:
[dart] No setter named 'title' in class 'Post'.
I'm not familar the builder
thing, even I found out that the PostBuilder
have the setter of all properties:
PostBuilder().title = 'hello world';
but how can I use it?