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

Flutter test snippets #20

Merged
merged 2 commits into from
May 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Awesome Flutter Snippets is a collection of commonly used Flutter classes and me
| `cupeapp` | Cupertino Package | Create a New Cupertino App.
| `tweenAnimationBuilder` | Tween Animation Builder | Widget builder that animates a property of a Widget to a target value whenever the target value changes.
| `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.
| `f-test` | Test | Create a test function.
| `f-testWidgets` | Test Widgets | Create a testWidgets function.

<br>

Expand Down
20 changes: 20 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,25 @@
" ),"
],
"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."
},
"Test": {
"prefix": "f-test",
"body": [
"test(",
" \"${1:test description}\",",
" () {},",
");"
],
"description": "Create a test function"
},
"Test Widgets": {
"prefix": "f-testWidgets",
"body": [
"testWidgets(",
" \"${1:test description}\",",
" (WidgetTester tester) async {},",
");"
],
"description": "Create a testWidgets function"
}
}