Skip to content

Instantly share code, notes, and snippets.

@Antoniozinchenko
Last active January 20, 2023 11:48
Show Gist options
  • Save Antoniozinchenko/1287f3f2364f485db753decc4e2d1a9a to your computer and use it in GitHub Desktop.
Save Antoniozinchenko/1287f3f2364f485db753decc4e2d1a9a to your computer and use it in GitHub Desktop.
vscode snippets for flutter/dart
{
"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