Skip to content

Instantly share code, notes, and snippets.

@BilalMoreno92
Forked from FilledStacks/stacked_snippets.json
Created January 10, 2023 23:39
Show Gist options
  • Save BilalMoreno92/32ebbc23e7a4b500539378a35dbe9afd to your computer and use it in GitHub Desktop.
Save BilalMoreno92/32ebbc23e7a4b500539378a35dbe9afd to your computer and use it in GitHub Desktop.

Revisions

  1. @FilledStacks FilledStacks revised this gist Mar 1, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@
    "import 'package:stacked/stacked.dart';",
    "",
    "class ${1} extends StatelessWidget {",
    " const ${1}({Key key}) : super(key: key);",
    " const ${1}({Key? key}) : super(key: key);",
    "",
    " @override",
    " Widget build(BuildContext context) {",
  2. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -88,7 +88,7 @@
    "void main() {",
    " group('${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} -', (){",
    " setUp(() => registerServices());",
    " tearDown(() => unregisterService());",
    " tearDown(() => unregisterServices());",
    " });",
    "}"
    ],
  3. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -80,6 +80,20 @@
    ],
    "description": "Main Test Suite Setup"
    },
    "Main Test Suite Setup with Services": {
    "prefix": "testmr",
    "body": [
    "import 'package:flutter_test/flutter_test.dart';",
    "",
    "void main() {",
    " group('${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} -', (){",
    " setUp(() => registerServices());",
    " tearDown(() => unregisterService());",
    " });",
    "}"
    ],
    "description": "Main Test Suite Setup with Services"
    },
    "Test Group Setup": {
    "prefix": "testg",
    "description": "Creates a Test group with a test",
  4. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@
    "${1} getAndRegister${1}() {",
    " _removeRegistrationIfExists<${1}>();",
    " final service = Mock${1}();",
    " locator.registerSingleton(service);",
    " locator.registerSingleton<${1}>(service);",
    " return service;",
    "}"
    ],
  5. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@
    "Mock Registration": {
    "prefix": "testr",
    "body": [
    "${1} getOrRegister${1}() {",
    "${1} getAndRegister${1}() {",
    " _removeRegistrationIfExists<${1}>();",
    " final service = Mock${1}();",
    " locator.registerSingleton(service);",
  6. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@
    " return service;",
    "}"
    ],
    "description": "Main Test Suite Setup"
    "description": "Creating a Mock Registration Function"
    },
    "Main Test Suite Setup": {
    "prefix": "testm",
  7. @FilledStacks FilledStacks revised this gist Apr 29, 2021. No changes.
  8. @FilledStacks FilledStacks revised this gist Apr 29, 2021. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -55,6 +55,18 @@
    ],
    "description": "Stacked BaseViewModel"
    },
    "Mock Registration": {
    "prefix": "testr",
    "body": [
    "${1} getOrRegister${1}() {",
    " _removeRegistrationIfExists<${1}>();",
    " final service = Mock${1}();",
    " locator.registerSingleton(service);",
    " return service;",
    "}"
    ],
    "description": "Main Test Suite Setup"
    },
    "Main Test Suite Setup": {
    "prefix": "testm",
    "body": [
  9. @FilledStacks FilledStacks revised this gist Apr 15, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    "prefix": "frz",
    "body": [
    "@freezed",
    "abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    "class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    " factory ${1}({",
    " @required ${2:String id},",
    " }) = _${1};",
    @@ -15,7 +15,7 @@
    "prefix": "frzjs",
    "body": [
    "@freezed",
    "abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    "class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    " factory ${1}({",
    " @required ${2:String id},",
    " }) = _${1};",
  10. @FilledStacks FilledStacks revised this gist Feb 23, 2021. 1 changed file with 0 additions and 7 deletions.
    7 changes: 0 additions & 7 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    {
    "Freezed model": {
    "scope": "dart,flutter",
    "prefix": "frz",
    "body": [
    "@freezed",
    @@ -13,7 +12,6 @@
    "description": "Freezed model"
    },
    "Freezed model Json": {
    "scope": "dart,flutter",
    "prefix": "frzjs",
    "body": [
    "@freezed",
    @@ -29,7 +27,6 @@
    "description": "Freezed model with Json"
    },
    "Stacked View": {
    "scope": "dart,flutter",
    "prefix": "stkv",
    "body": [
    "import 'package:flutter/material.dart';",
    @@ -50,7 +47,6 @@
    "description": "Stacked View"
    },
    "Stacked BaseViewModel": {
    "scope": "dart,flutter",
    "prefix": "stkbvm",
    "body": [
    "import 'package:stacked/stacked.dart';",
    @@ -60,7 +56,6 @@
    "description": "Stacked BaseViewModel"
    },
    "Main Test Suite Setup": {
    "scope": "dart,flutter",
    "prefix": "testm",
    "body": [
    "import 'package:flutter_test/flutter_test.dart';",
    @@ -74,7 +69,6 @@
    "description": "Main Test Suite Setup"
    },
    "Test Group Setup": {
    "scope": "dart,flutter",
    "prefix": "testg",
    "description": "Creates a Test group with a test",
    "body": [
    @@ -86,7 +80,6 @@
    ]
    },
    "Single Test Setup": {
    "scope": "dart,flutter",
    "prefix": "tests",
    "description": "Creates a single test",
    "body": [
  11. @FilledStacks FilledStacks revised this gist Jun 14, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    {
    "Freezed model": {
    "scope": "dart,flutter",
    "prefix": "frz",
    "body": [
    "@freezed",
    @@ -12,6 +13,7 @@
    "description": "Freezed model"
    },
    "Freezed model Json": {
    "scope": "dart,flutter",
    "prefix": "frzjs",
    "body": [
    "@freezed",
    @@ -27,6 +29,7 @@
    "description": "Freezed model with Json"
    },
    "Stacked View": {
    "scope": "dart,flutter",
    "prefix": "stkv",
    "body": [
    "import 'package:flutter/material.dart';",
    @@ -47,6 +50,7 @@
    "description": "Stacked View"
    },
    "Stacked BaseViewModel": {
    "scope": "dart,flutter",
    "prefix": "stkbvm",
    "body": [
    "import 'package:stacked/stacked.dart';",
    @@ -56,6 +60,7 @@
    "description": "Stacked BaseViewModel"
    },
    "Main Test Suite Setup": {
    "scope": "dart,flutter",
    "prefix": "testm",
    "body": [
    "import 'package:flutter_test/flutter_test.dart';",
    @@ -69,6 +74,7 @@
    "description": "Main Test Suite Setup"
    },
    "Test Group Setup": {
    "scope": "dart,flutter",
    "prefix": "testg",
    "description": "Creates a Test group with a test",
    "body": [
    @@ -80,6 +86,7 @@
    ]
    },
    "Single Test Setup": {
    "scope": "dart,flutter",
    "prefix": "tests",
    "description": "Creates a single test",
    "body": [
  12. @FilledStacks FilledStacks created this gist Jun 7, 2020.
    91 changes: 91 additions & 0 deletions stacked_snippets.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,91 @@
    {
    "Freezed model": {
    "prefix": "frz",
    "body": [
    "@freezed",
    "abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    " factory ${1}({",
    " @required ${2:String id},",
    " }) = _${1};",
    "}"
    ],
    "description": "Freezed model"
    },
    "Freezed model Json": {
    "prefix": "frzjs",
    "body": [
    "@freezed",
    "abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {",
    " factory ${1}({",
    " @required ${2:String id},",
    " }) = _${1};",
    "",
    "factory ${1}.fromJson(Map<String, dynamic> json) => ",
    "_$${1}FromJson(json);",
    "}"
    ],
    "description": "Freezed model with Json"
    },
    "Stacked View": {
    "prefix": "stkv",
    "body": [
    "import 'package:flutter/material.dart';",
    "import 'package:stacked/stacked.dart';",
    "",
    "class ${1} extends StatelessWidget {",
    " const ${1}({Key key}) : super(key: key);",
    "",
    " @override",
    " Widget build(BuildContext context) {",
    " return ViewModelBuilder<${1}Model>.reactive(",
    " builder: (context, model, child) => Scaffold(),",
    " viewModelBuilder: () => ${1}Model(),",
    " );",
    " }",
    "}"
    ],
    "description": "Stacked View"
    },
    "Stacked BaseViewModel": {
    "prefix": "stkbvm",
    "body": [
    "import 'package:stacked/stacked.dart';",
    "",
    "class ${1}Model extends BaseViewModel {}",
    ],
    "description": "Stacked BaseViewModel"
    },
    "Main Test Suite Setup": {
    "prefix": "testm",
    "body": [
    "import 'package:flutter_test/flutter_test.dart';",
    "",
    "void main() {",
    " group('${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} -', (){",
    "",
    " });",
    "}"
    ],
    "description": "Main Test Suite Setup"
    },
    "Test Group Setup": {
    "prefix": "testg",
    "description": "Creates a Test group with a test",
    "body": [
    "group('${1} -', () {",
    " test('${2}', () {",
    "",
    " });",
    "});",
    ]
    },
    "Single Test Setup": {
    "prefix": "tests",
    "description": "Creates a single test",
    "body": [
    " test('${1}', () {",
    "",
    " });",
    ]
    },
    }