flutter_twin_scroller 0.0.1+2 copy "flutter_twin_scroller: ^0.0.1+2" to clipboard
flutter_twin_scroller: ^0.0.1+2 copied to clipboard

A Flutter package to sync scroll position between multiple ScrollControllers

Flutter TwinScroller #

A Flutter package to sync scroll position between multiple ScrollControllers

iOS Demo #

Demo iOS Flutter TwinScroll

Android Demo #

Demo Android Flutter TwinScroll

Features #

  • Sync ScrollController of different Widgets
  • Sync ScrollController between pages
  • Supports BouncingScrollPhysics (iOS) & ClampingScrollPhysics (Android) ScrollPhysics

Requirements #

  • All the widgets that have a TwinScrollController binded must have the same scroll area (Same width if is horizontal or height if is vertical).

Usage #

  1. Create the TwinScrollController
final twinScrollController = TwinScrollController();
  1. Use the TwinScroller Widget to bind the ScrollController with the TwinScrollController
TwinScroller(
    controller: twinScrollController,
    childScrollController: scrollController,
    child: ListView.builder(
        controller: scrollController,
        itemCount: 20,
        itemBuilder: (context, index) {
            child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Row(
                    children: [
                        Text(
                            'Item: $index',
                            style: const TextStyle(color: Colors.black),
                        )
                    ],
                ),
            );
        },
    ),
),

And all the ScrollControls that have the same TwinScrollController will be the same scroll position

Additional information #

Feel free to contribute, more info at GitHub

3
likes
140
pub points
22%
popularity

Publisher

verified publisherranierjardim.com

A Flutter package to sync scroll position between multiple ScrollControllers

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_twin_scroller