-
-
Save peekpt/67a667697e491248eadce21c9dd6c8d5 to your computer and use it in GitHub Desktop.
flutter built_value live templates
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
abstract class $NAME$ implements Built<$NAME$, $NAME$Builder> { | |
$END$// fields go here}", | |
$NAME$._(); | |
factory $NAME$([updates($NAME$Builder b)]) = _$$$NAME$; | |
} |
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
library $NAME$; | |
import 'dart:convert'; | |
import 'package:built_collection/built_collection.dart'; | |
import 'package:built_value/built_value.dart'; | |
import 'package:built_value/serializer.dart'; | |
part '$NAME$.g.dart'; |
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
abstract class $NAME$ implements Built<$NAME$, $NAME$Builder> { | |
$END$ // fields go here | |
$NAME$._(); | |
factory $NAME$([updates($NAME$Builder b)]) = _$$$NAME$; | |
String toJson() { | |
return json.encode(serializers.serializeWith($NAME$.serializer, this)); | |
} | |
static $NAME$ fromJson(String jsonString) { | |
return serializers.deserializeWith($NAME$.serializer, json.decode(jsonString)); | |
} | |
static Serializer<$NAME$> get serializer => _$$$NAME1$Serializer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment