page_view_dot_indicator 2.3.0 copy "page_view_dot_indicator: ^2.3.0" to clipboard
page_view_dot_indicator: ^2.3.0 copied to clipboard

A simple and animated page view indicator in the form of dots, which you can customise color, size, space and duration.

Page view dot indicator #

pub package

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.

Usage #

Simply use this Widget in your page and make sure to use any form of state management to update the currentItem, such as setState.

These are the mandatory parameters:

PageViewDotIndicator(
  currentItem: selectedPage,
  count: pageCount,
  unselectedColor: Colors.black26,
  selectedColor: Colors.blue,
)

But you can also customize it using other parameters, such as:

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) { ... }
)
65
likes
150
points
15.8k
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and animated page view indicator in the form of dots, which you can customise color, size, space and duration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on page_view_dot_indicator