Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
Created April 28, 2020 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukepighetti/1b4539c4050cbbfc107f7f49e9638dab to your computer and use it in GitHub Desktop.
Save lukepighetti/1b4539c4050cbbfc107f7f49e9638dab to your computer and use it in GitHub Desktop.
VSCode snippets
{
"Freezed model": {
"prefix": "frz",
"body": [
"import 'package:freezed_annotation/freezed_annotation.dart';",
"",
"part '$TM_FILENAME_BASE.freezed.dart';",
"",
"@freezed",
"abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
" factory ${1}({",
" @required ${2:String id},",
" }) = _${1};",
"}"
],
"description": "Freezed model"
}
}
{
"Stateless widget with theme and size": {
"prefix": "stll",
"body": [
"import 'package:flutter/material.dart';",
"",
"class ${1:MyWidget}Size {}",
"",
"class ${1:MyWidget}Theme {}",
"",
"class ${1:MyWidget} extends StatelessWidget {",
" ${1:MyWidget}()",
" : size = ${1:MyWidget}Size(),",
" theme = ${1:MyWidget}Theme();",
"",
" final ${1:MyWidget}Size size;",
" final ${1:MyWidget}Theme theme;",
"",
" ${2}",
"",
" @override",
" Widget build(BuildContext context) {",
" return Container();",
" }",
"}",
""
],
"description": "Stateless widget with theme and size"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment