Last active
January 20, 2023 11:48
-
-
Save Antoniozinchenko/1287f3f2364f485db753decc4e2d1a9a to your computer and use it in GitHub Desktop.
vscode snippets for flutter/dart
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
{ | |
"JsonSerializable class": { | |
"prefix": "classjson", | |
"body": [ | |
"import 'package:json_annotation/json_annotation.dart';", | |
"", | |
"part '${TM_FILENAME_BASE}.g.dart';", | |
"", | |
"@JsonSerializable()", | |
"class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} {", | |
" const ${1}();", | |
"", | |
" factory ${1}.fromJson(Map<String, dynamic> json) => _$${1}FromJson(json);", | |
"", | |
" Map<String, dynamic> toJson() => _$${1}ToJson(this);", | |
"}" | |
], | |
"description": "Class generated with json serializable" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment