Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook Consumer Stateful Widget addition. #20

17 changes: 8 additions & 9 deletions snippets/consumer_widgets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"prefix": "stlessConsumer",
"description": "Create a ConsumerStatelessWidget",
"body": [
"class $1 extends ConsumerWidget {",
"\tconst $1({Key? key}) : super(key: key);",
"class ${1:name} extends ConsumerWidget {",
rafaelortizzableh marked this conversation as resolved.
Show resolved Hide resolved
"\tconst ${1:name}({Key? key}) : super(key: key);\n",
"\t@override",
"\tWidget build(BuildContext context, WidgetRef ref) {",
"\t\treturn Container();",
Expand All @@ -18,18 +18,17 @@
"prefix": "stfulConsumer",
"description": "Create a ConsumerStatefulWidget",
"body": [
"class $1 extends ConsumerStatefulWidget {",
"class ${1:name} extends ConsumerStatefulWidget {",
"\tconst ${1:name}({Key? key}) : super(key: key);\n",
"\t@override",
"\tConsumerState<ConsumerStatefulWidget> createState() => _$1State();",
"}",

"class _$1State extends ConsumerState<$1> {",

"\tConsumerState<ConsumerStatefulWidget> createState() => _${1:name}State();",
"}\n",
"class _${1:name}State extends ConsumerState<${1:name}> {\n",
"\t@override",
"\tWidget build(BuildContext context) {",
"\t\treturn Container();",
"\t}",
"}"
]
}
}
}
28 changes: 24 additions & 4 deletions snippets/hook_consumer.code-snippets
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
{
"Hook Consumer Widget": {
"Hook Consumer Stateless Widget": {
"scope": "dart",
"prefix": "hookConsumer",
"prefix": "hookStlessConsumer",
rafaelortizzableh marked this conversation as resolved.
Show resolved Hide resolved
"description": "Create a HookConsumerWidget",
"body": [
"class $1 extends HookConsumerWidget {",
"\tconst $1({Key? key}) : super(key: key);",
"class ${1:name} extends HookConsumerWidget {",
"\tconst ${1:name}({Key? key}) : super(key: key);",

"\t@override",
"\tWidget build(BuildContext context, WidgetRef ref) {",
"\t\treturn Container();",
"\t}",
"}"
]
},
"Hook Consumer Stateful Widget": {
"scope": "dart",
"prefix": "hookStfulConsumer",
rafaelortizzableh marked this conversation as resolved.
Show resolved Hide resolved
"description": "Create a StatefulHookConsumerWidget",
"body": [
"class ${1:name} extends StatefulHookConsumerWidget {",
"\tconst ${1:name}({Key? key}) : super(key: key);\n",
"\t@override",
"\tConsumerState<ConsumerStatefulWidget> createState() => _${1:name}State();",
"}",

"class _${1:name}State extends ConsumerState<${1:name}> {",

"\t@override",
"\tWidget build(BuildContext context) {",
"\t\treturn Container();",
"\t}",
"}"
]
}
}