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 ↗