Features
Flutter package for listview with pagination.
Warning I build this package for my own usage. I not perform test outside my own needs and my flutter environment.
Feature
- List Items can be grouped
- List Items can be selected or unselected
- List support pagination
Basic Usage
Create Future function to fetch data
Future<List<DyItemData<String>>> _fetchApi(DyFetchParam param) async {
await Future.delayed(const Duration(seconds: 5));
return [
"A","B","C","D","E"
];
}
Setup list controller
DyListViewController<String> controller =
controller = DyListViewController<String>(
direction: Axis.vertical,
refreshStateParentWidget: () {
if(mounted){
setState(() {});
}
},
fetchData: _fetchApi,
);
Passing list controller to widget
DyListView<String>(
controller: controller,
itemBuilder: (context, index, item) {
return Ink(
child: InkWell(
onTap: () => controller.selectItem(
data: item, isSetToSelected: !item.isSelected),
child: _Item(
data: item.data,
currentPage: item.page,
isSelected: item.isSelected,
),
),
);
},
),
Add additional Widget
DyListView<String>(
...
addonWidget: DyListViewAddonConfig(
start: DyAddonWidgetConfig(
stickWidgetBuilder: (
context,
state,
) {
return Container(
height: 20,
color: Colors.amber,
);
},
padding: 0,
builder: (
context,
state,
) {
return generateTopWidget(context);
},
),
end: DyAddonWidgetConfig(
stickWidgetBuilder: (context, state) => Container(
height: 20,
color: Colors.red,
),
padding: 20,
builder: (context, state) {
return const _EndPage();
},
)),
),
Migrate from prev version
- (Breaking Changed) Migrate from SelectPagingListView, PageableListView to DyListView
For more usage examples, please take check out the example project.
Libraries
- container/refresh_empty_listview_container
- container/scroll_from_animated_container
- dy_list/component/container_empty_listview
- dy_list/controller
- dy_list/index
- dy_list/model/group
- dy_list/model/index
- dy_list/model/item
- dy_list/model/widget
- dynamic_paging_listview_widget
- listview/component/empty_view_listview
- listview/component/error_view_listview
- listview/component/index
- listview/component/loading_view_listview
- listview/component/my_wraper
- listview/controller/model/model
- listview/controller/model/pageable_group_item
- listview/controller/model/pageable_item_data
- listview/controller/scroll_from_animated_container_controller
- listview/controller/selectable_list_view_controller
- listview/pageable_list_view
- listview/selectable_list_view
- model/index