v0.5.0scroll_pos
為 ScrollController 提供一些額外功能,以定義項目相對於螢幕的位置。
75喜歡 19.4萬近 30 天下載160Pub 分數
AndroidiOSWebmacOSWindowsLinux
為 ScrollController 提供一些額外功能,以定義項目相對於螢幕的位置。
以下為英文專案原文快照,最新內容請造訪 GitHub。
Provides some additional functions to ScrollController to define item position relative to the screen.
A live version is available here.
Note: this works on condition that all items have the same height !
// Create a ScrollPosController (don't forget to set and update itemCount !)
final controller = ScrollPosController(itemCount: itemCount);
// Assign the controller to a scrollable item (like an ListView)
ListView(
controller: controller,
children: [
...
];
);
// Control the controller
TextButton(
child: Text('To item'),
onPressed: () {
setState(() {
controller.scrollToItem(index);
});
},
);
void scrollTop({bool? animate}) : Go to the first itemvoid scrollBottom({bool? animate}) : Go to the last itemvoid scrollToItem(int index, {bool? animate, bool center = false}) : Makes the item visible on the screen依賴清單 3 項
{"sdk":"flutter"}{"sdk":"flutter"}^1.0.0先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗