Skip to content

Commit ba6d825

Browse files
authored
Flutter test snippets (#20)
* Created snippets for the test and testWidgets functions * new line at EOF
1 parent 10bd5d3 commit ba6d825

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Awesome Flutter Snippets is a collection of commonly used Flutter classes and me
4343
| `cupeapp` | Cupertino Package | Create a New Cupertino App.
4444
| `tweenAnimationBuilder` | Tween Animation Builder | Widget builder that animates a property of a Widget to a target value whenever the target value changes.
4545
| `valueListenableBuilder` | Value Listenable Builder | Given a ValueListenable<T> and a builder which builds widgets from concrete values of T, this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes.
46+
| `f-test` | Test | Create a test function.
47+
| `f-testWidgets` | Test Widgets | Create a testWidgets function.
4648

4749
<br>
4850

snippets/snippets.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,5 +418,25 @@
418418
" ),"
419419
],
420420
"description": "Given a ValueListenable<T> and a builder which builds widgets from concrete values of T, this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes."
421+
},
422+
"Test": {
423+
"prefix": "f-test",
424+
"body": [
425+
"test(",
426+
" \"${1:test description}\",",
427+
" () {},",
428+
");"
429+
],
430+
"description": "Create a test function"
431+
},
432+
"Test Widgets": {
433+
"prefix": "f-testWidgets",
434+
"body": [
435+
"testWidgets(",
436+
" \"${1:test description}\",",
437+
" (WidgetTester tester) async {},",
438+
");"
439+
],
440+
"description": "Create a testWidgets function"
421441
}
422442
}

0 commit comments

Comments
 (0)