Created
April 28, 2020 22:10
-
-
Save lukepighetti/1b4539c4050cbbfc107f7f49e9638dab to your computer and use it in GitHub Desktop.
VSCode snippets
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
{ | |
"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" | |
} | |
} |
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
{ | |
"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