Created
July 3, 2020 08:44
-
-
Save miquelbeltran/a357b97218d7ebf64c8d94531e5c9f4a to your computer and use it in GitHub Desktop.
Dart Live Templates for built_value
This file contains hidden or 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
/// built_value template | |
/// variables: | |
/// CLASS_NAME | |
abstract class $CLASS_NAME$ implements Built<$CLASS_NAME$, $CLASS_NAME$Builder> { | |
factory $CLASS_NAME$([void Function($CLASS_NAME$Builder) updates]) = _$$$CLASS_NAME$; | |
$CLASS_NAME$._(); | |
} | |
/// Serializer | |
/// CLASS_NAME dartClassName() skip if defined: true | |
/// CLASS_NAME_CAMEL camelCase(dartClassName()) skip if defined: true | |
static Serializer<$CLASS_NAME$> get serializer => _$$$CLASS_NAME_CAMEL$Serializer; | |
/// Enum | |
/// ENUM_NAME | |
/// ENUM_NAME_CAMEL camelCase($ENUM_NAME$) skip if defined true | |
/// VALUE | |
class $ENUM_NAME$ extends EnumClass { | |
static Serializer<$ENUM_NAME$> get serializer => _$$$ENUM_NAME_CAMEL$Serializer; | |
static const $ENUM_NAME$ $VALUE$ = _$$$VALUE$; | |
const $ENUM_NAME$._(String name) : super(name); | |
static BuiltSet<$ENUM_NAME$> get values => _$values; | |
static $ENUM_NAME$ valueOf(String name) => _$valueOf(name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment