FLUTTER ECOSYSTEM

erf/load_items

在滾動到 ListView 或 GridView 底部時載入新項目

載入項目 專案封面
Stars
2
Forks
1
最近推送(UTC)
2025年6月25日
專案狀態
未封存
Erlend GitHub avatar
GITHUB User

Erlend ↗

語言DartHTMLSwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^6.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

load_items

Load new items into either a list or a grid as you scroll down.

screencast

Features

  • load new items when scrolling to the bottom of a ListView or GridView
  • pagination support by passing the previous items to ItemsLoader
  • add custom widget builders for items, loaders and empty widgets
  • configurable ListView and GridView
  • configure when to load more via loadScrollFactor
  • pull-to-refresh to reload data
  • force refresh using a Listenable
  • scroll to top using a Listenable
  • fade out bottom if more option

Example

LoadItems<Item>(
	type: LoadItemsType.grid,
	itemBuilder: (context, Item item, int index) {
		return ListTile(title: item.title);
	},
	itemsLoader: (List<Item> currentItems) {
		return await Api.fetch({skip: currentItems.length});
	},
	gridCrossAxisCount: 3,
)

See example for full list and grid example.