Skip to content

Commit 2ee04ad

Browse files
Added support for Listview.Separated (#26)
* Added support for ListView.separated * Update README.md
1 parent ba6d825 commit 2ee04ad

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Awesome Flutter Snippets is a collection of commonly used Flutter classes and me
2020
| `customClipper` | Custom Clipper | Used for creating custom shapes |
2121
| `customPainter` | Custom Painter | Used for creating custom paint |
2222
| `listViewB` | ListView.Builder | Creates a scrollable, linear array of widgets that are created on demand.Providing a non-null `itemCount` improves the ability of the `ListView` to estimate the maximum scroll extent. |
23+
| `listViewS` | ListView.Separated | Creates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'. |
2324
| `customScrollV` | Custom ScrollView | Creates a `ScrollView` that creates custom scroll effects using slivers. If the `primary` argument is true, the `controller` must be null. |
2425
| `streamBldr` | Stream Builder | Creates a new `StreamBuilder` that builds itself based on the latest snapshot of interaction with the specified `stream` |
2526
| `animatedBldr` | Animated Builder | Creates an Animated Builder. The widget specified to `child` is passed to the `builder` |

snippets/snippets.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,21 @@
143143
],
144144
"description": "Creates a scrollable, linear array of widgets that are created on demand.Providing a non-null `itemCount` improves the ability of the [ListView] to estimate the maximum scroll extent."
145145
},
146+
"ListView.Separated": {
147+
"prefix": "listViewS",
148+
"body": [
149+
"ListView.separated(",
150+
" itemCount: ${1:1},",
151+
" separatorBuilder: (BuildContext context, int index) {",
152+
" return ${2:};",
153+
" },",
154+
" itemBuilder: (BuildContext context, int index) {",
155+
" return ${3:};",
156+
" },",
157+
"),"
158+
],
159+
"description": "Creates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'."
160+
},
146161
"Custom Scroll View": {
147162
"prefix": "customScrollV",
148163
"body": [

0 commit comments

Comments
 (0)