v2.3.0page_view_dot_indicator
一個簡單且帶有動畫效果的頁面視圖指示器,以圓點形式呈現,您可以自訂顏色、大小、間距和持續時間。
75喜歡 1.2萬近 30 天下載160Pub 分數
AndroidiOSWebmacOSWindowsLinux
一個簡單且帶有動畫效果的頁面視圖指示器,以圓點形式呈現,您可以自訂顏色、大小、間距和持續時間。
{"sdk":"flutter"}{"sdk":"flutter"}2.0.2以下為英文專案原文快照,最新內容請造訪 GitHub。
This lib draws a simple dot indicator for page views with a simple API. Right now it is able to draw dots with custom size, colors, spacing and duration. Besides that it also handles overflow by fading the edges if there are more dots than the width of the page allows.
https://user-images.githubusercontent.com/1608564/111876654-7f539200-897e-11eb-9d1e-7a9ceb820ec7.gifSimply use this Widget in your page and make sure to use any form of state management to update the currentItem, such as setState.
PageViewDotIndicator(
currentItem: selectedPage,
count: pageCount,
unselectedColor: Colors.black26,
selectedColor: Colors.blue,
)
PageViewDotIndicator(
currentItem: selectedPage,
count: pageCount,
unselectedColor: Colors.black26,
selectedColor: Colors.blue,
size: const Size(12, 12),
unselectedSize: const Size(8, 8),
duration: const Duration(milliseconds: 200),
margin: const EdgeInsets.symmetric(horizontal: 8),
padding: EdgeInsets.zero,
alignment: Alignment.centerLeft,
fadeEdges: false,
boxShape: BoxShape.square, //defaults to circle
borderRadius: BorderRadius.circular(5), //only for rectangle shape
onItemClicked: (index) { ... }
)