提交 c48b6b2c authored 作者: caoyongfeng's avatar caoyongfeng

listView功能扩展

上级 6fbca4c6
...@@ -273,6 +273,22 @@ class _BaseListWidgetState extends State<BaseListWidget> { ...@@ -273,6 +273,22 @@ class _BaseListWidgetState extends State<BaseListWidget> {
} }
} }
// 删除单个数据
void removeItem(item) {
_dataList.remove(item);
if (mounted) {
setState(() {});
}
}
// 删除单个数据
void removeItemIndex(index) {
_dataList.removeAt(index);
if (mounted) {
setState(() {});
}
}
// 禁止手动触发滚动 // 禁止手动触发滚动
void setDisallowScroll() { void setDisallowScroll() {
if (mounted) { if (mounted) {
...@@ -337,6 +353,14 @@ class BaseListController { ...@@ -337,6 +353,14 @@ class BaseListController {
_listState?.notifySingleItem(index, item); _listState?.notifySingleItem(index, item);
} }
void removeItem(item) {
_listState?.removeItem(item);
}
void removeItemIndex(index) {
_listState?.removeItemIndex(index);
}
// 滚动到某个item index 位置 // 滚动到某个item index 位置
void scrollToIndex( void scrollToIndex(
int index, int index,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论