Skip to content

Commit 6b84a5c

Browse files
committed
Added support for Value Listenable Builder
1 parent e1534d8 commit 6b84a5c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Awesome Flutter Snippets is a collection of commonly used Flutter classes and me
4141
| `mateapp` | Material App | Create a new Material App.
4242
| `cupeapp` | Cupertino Package | Create a New Cupertino App.
4343
| `tweenAnimationBuilder` | Tween Animation Builder | Widget builder that animates a property of a Widget to a target value whenever the target value changes.
44+
| `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.
4445

4546
<br>
4647

snippets/snippets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,5 +402,16 @@
402402
],
403403
"description": "Widget builder that animates a property of a Widget to a target value whenever the target value changes."
404404
},
405+
"Value Listenable Builder": {
406+
"prefix": "valueListenableBuilder",
407+
"body": [
408+
"ValueListenableBuilder(",
409+
" valueListenable: ${1: null},",
410+
" builder: (BuildContext context, ${2:dynamic} value, Widget child) {",
411+
" return ${3: Container();}",
412+
" },",
413+
" ),"
414+
],
415+
"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."
405416
}
406417
}

0 commit comments

Comments
 (0)