sliding_window_indicator 0.1.0 copy "sliding_window_indicator: ^0.1.0" to clipboard
sliding_window_indicator: ^0.1.0 copied to clipboard

A Flutter PageView line indicator with a sliding visible window of lines. Ideal for carousels and galleries with many pages.

sliding_window_indicator #

CI pub package

A lightweight Flutter PageView line indicator with a sliding visible window.

Show a fixed number of lines while the active selection scrolls through a longer page list — ideal for carousels and galleries with many pages.

Demo

Features #

  • Sliding window of lines for large itemCount
  • Driven by a PageController (smooth mid-scroll interpolation)
  • Horizontal or vertical orientation
  • Customizable colors, spacing, size, and border radius
  • Supports viewportFraction for peek-style PageViews
  • Zero third-party dependencies beyond Flutter

Install #

dependencies:
  sliding_window_indicator: ^0.1.0
import 'package:sliding_window_indicator/sliding_window_indicator.dart';

Usage #

final controller = PageController();

Column(
  children: [
    Expanded(
      child: PageView.builder(
        controller: controller,
        itemCount: 12,
        itemBuilder: (context, index) => Center(child: Text('Page $index')),
      ),
    ),
    SlidingWindowIndicator(
      itemCount: 12,
      controller: controller,
      visibleLineCount: 4,
      lineColor: Colors.grey.shade400,
      lineSelectedColor: Colors.black,
    ),
  ],
)

Customization #

Parameter Description
itemCount Total number of pages / lines
controller PageController driving selection
lineColor Color of inactive lines
lineSelectedColor Color of the selected line
lineSpacing Gap between consecutive lines
visibleLineCount Max lines shown in the window
orientation Axis.horizontal or Axis.vertical
lineWidth Length of each line along the main axis
lineHeight Thickness of each line
lineBorderRadius Corner radius for drawn lines
viewportFraction Match PageController.viewportFraction when < 1.0

Example #

See the example/ app for a PageView carousel with the sliding-window indicator underneath.

License #

MIT

0
likes
160
points
86
downloads
screenshot

Documentation

API reference

Publisher

verified publisherayushd70.dev

Weekly Downloads

A Flutter PageView line indicator with a sliding visible window of lines. Ideal for carousels and galleries with many pages.

Repository (GitHub)
View/report issues

Topics

#ui #indicator #pageview #carousel #widget

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sliding_window_indicator