Last active
March 18, 2021 09:28
-
-
Save bkanhu/b624a3741ec73924e6416da37f57ded4 to your computer and use it in GitHub Desktop.
Flutter snippets for making stateful and stateless widgets. Open Visual Studio Code press "Control+Shift+P", Search for Snippet, then choose dart. and paste this code to that "dart.json" file and save it.
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": { | |
"prefix": "stless", | |
"body": [ | |
"class $1 extends StatelessWidget {", | |
"\t@override", | |
"\tWidget build(BuildContext context) {", | |
"\t\treturn Container(", | |
"\t\t\t$2", | |
"\t\t);", | |
"\t}", | |
"}" | |
] | |
}, | |
"stateful": { | |
"prefix": "stfull", | |
"body": [ | |
"class $1 extends StatefulWidget {", | |
"\t@override", | |
" \t_$1State createState() => _$1State();", | |
"}", | |
"class _$1State extends State<$1> {", | |
" \t@override", | |
" \tWidget build(BuildContext context) {", | |
"\t\treturn Container(", | |
" \t\t\t$2", | |
"\t\t);", | |
"\t}", | |
"} " | |
] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment