Created
March 15, 2020 19:56
-
-
Save JEuler/f2bedaab15ad840b9c3371e9bb306cef to your computer and use it in GitHub Desktop.
BuiltValue User model example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:built_value/built_value.dart'; | |
import 'package:built_value/serializer.dart'; | |
import 'user_with_relations.dart'; | |
part 'user.g.dart'; | |
// ignore_for_file: public_member_api_docs | |
abstract class User implements Built<User, UserBuilder> { | |
factory User([void Function(UserBuilder) updates]) = _$User; | |
User._(); | |
static Serializer<User> get serializer => _$userSerializer; | |
@nullable | |
int get id; | |
@nullable | |
String get name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment