Appearance
List Tile
A representation of Lists.
NikuListView
accepts all the props as same as ListView.
// Using namespace
n.ListView.children([]);
// Using Niku Prefix
NikuListView.children([]);
Example Usage
n.ListView.children([
"1".n,
"2".n,
"3".n,
]);
Using Builder
n.ListView.builder()
..total = 100
..useItemBuilder(
(context, index) => n.ListTile()
..title = n.Text(index.n)
..dense = true,
);
Using Separated
n.ListView.separated()
..total = 100
..useItemBuilder(
(context, index) => n.ListTile()
..title = n.Text(index.n)
..subtitle = n.Text(index.n)
)
..useSeparatorBuilder((context, index) => Divider(height: 1));
ShrinkWrap
Use shrinkWrap
when you are placing ListView inside dynamic height layout like Scrollable
n.Column([
n.ListView.builder()
..total = 10
..useItemBuilder((context, index) => n.ListTile()
..title = n.Text(index.n)
)
..shrinkWrap;
])
..scrollable;
Factory Method
Niku can accepts 5 factory method.
Factory Method | Equivalent Widget |
---|---|
n.ListView | ListView |
n.ListView.children | - |
n.ListView.builder | ListView.builder |
n.ListView.separated | ListView.separated |
n.ListView.custom | ListView.custom |