Skip to content

Commit

Permalink
Merge pull request #3 from eligt/master
Browse files Browse the repository at this point in the history
Added child logic to Stateless and Stateful widgets snippets
  • Loading branch information
Nash0x7E2 committed Feb 6, 2019
2 parents 67080a2 + 1004e33 commit 4be5f61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"prefix": "stlss",
"body": [
"class ${1:name} extends StatelessWidget {",
" final Widget ${2:child};\n",
" ${1:name}({Key key, this.${2:child}}) : super(key: key);\n",
" @override",
" Widget build(BuildContext context) {",
" return Container(",
Expand All @@ -17,13 +19,15 @@
"prefix": "stful",
"body": [
"class ${1:name} extends StatefulWidget {",
" final Widget ${2:child};\n",
" ${1:name}({Key key, this.${2:child}}) : super(key: key);\n",
" _${1:WidgetName}State createState() => _${1:WidgetName}State();",
"}\n",
"class _${1:index}State extends State<${1:index}> {",
" @override",
" Widget build(BuildContext context) {",
" return Container(",
" child: ${2:child},",
" child: widget.${2:child},",
" );",
" }",
"}"
Expand Down

0 comments on commit 4be5f61

Please sign in to comment.