Skip to content

Instantly share code, notes, and snippets.

@luizjacomn
Last active December 28, 2021 04:07
Show Gist options
  • Save luizjacomn/edc6546e657b121a37b450a343c654cc to your computer and use it in GitHub Desktop.
Save luizjacomn/edc6546e657b121a37b450a343c654cc to your computer and use it in GitHub Desktop.
Snippets VSCode para Dart/Flutter
{
"aaaTest": {// criar estrutura de testes "triple a" (arrange, act, assert)
"prefix": "aaa",
"body": [
"test(",
"\t'should $1',",
"\t() async {",
"\t\t// arrange",
"\t\t$2",
"\t\t// act",
"\t\t$3",
"\t\t// assert",
"\t\t$4",
"\t},",
");"
],
},
// Pressionar "tab" para processar instrução "part" para lowercase
"mobxStore": {// criar Store Mobx
"prefix": "mobS",
"body": [
"import 'package:mobx/mobx.dart';\n",
"part '${TM_FILENAME_BASE}.g.dart';\n",
"class $1 = _$1Base with _$$1;\n",
"abstract class _$1Base with Store {}"
],
},
"mobxController": {// criar Controller Mobx
"prefix": "mobC",
"body": [
"import 'package:mobx/mobx.dart';\n",
"part '${TM_FILENAME_BASE}.g.dart';\n",
"class $1Controller = _$1ControllerBase with _$$1Controller;\n",
"abstract class _$1ControllerBase with Store {}"
],
},
"obs": {// criar Observer Mobx
"prefix": "obs",
"body": [
"Observer(",
"\tbuilder: (_) {",
"\t\treturn $1;",
"\t},",
")",
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment