Created
January 25, 2019 11:19
-
-
Save SebastianKlaiber/a4ca60d2b082185edc97fff6763e6a03 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; | |
} |
Author
SebastianKlaiber
commented
Jan 25, 2019
amazing!
Awesome work! Thanks :)
good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment