parallel_scroll_view 0.0.1 copy "parallel_scroll_view: ^0.0.1" to clipboard
parallel_scroll_view: ^0.0.1 copied to clipboard

A widget that can scroll multiple ScrollView at once

parallel_scroll_view #

A widget that can scroll multiple ScrollView at once

Demo #

preview

class ParallelScrollViewDemo extends StatefulWidget {
  @override
  _ParallelScrollViewDemoState createState() =>
      _ParallelScrollViewDemoState();
}

class _ParallelScrollViewDemoState
    extends State<ParallelScrollViewDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ParallelScrollView(
        scrollDirection: Axis.vertical,
        behavior: ParallelScrollBehavior.Interpolate,
        padding: EdgeInsets.all(12),
        children: <Widget>[
          ParallelScrollChild(
            height: 100,
            width: 100,
            children: _getList(10, 100, 100, Colors.red),
          ),
          _buildLabel(),
          ParallelScrollChild(
            height: 100,
            width: 100,
            children: _getList(7, 100, 100, Colors.blue),
          ),
          _buildLabel(),
          ParallelScrollChild(
            height: 50,
            width: 100,
            children: _getList(10, 150, 50, Colors.yellow),
          ),
        ],
      ),
    );
  }

  Container _buildLabel() {
    return Container(
      height: 40,
      width: 100,
      margin: EdgeInsets.all(12),
      alignment: Alignment.center,
      color: Colors.green,
      child: Text("Label"),
    );
  }

  List<Widget> _getList(int count, double width, double height, Color color) {
    return List.generate(
        count,
        (i) => Container(
              margin: EdgeInsets.only(right: 12),
              alignment: Alignment.center,
              width: width,
              height: height,
              color: color,
              child: Text("Item $i"),
            ));
  }
}
0
likes
10
pub points
0%
popularity

Publisher

unverified uploader

A widget that can scroll multiple ScrollView at once

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on parallel_scroll_view