snapping_page_scroll 3.1.0 copy "snapping_page_scroll: ^3.1.0" to clipboard
snapping_page_scroll: ^3.1.0 copied to clipboard

A plugin that allows you to make a pageView that scrolls a certain number of pages based on the scroll velocity, and then snaps to the nearest page.

example/example.dart

import 'package:flutter/material.dart';
import 'package:snapping_page_scroll/snapping_page_scroll.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  Widget customCard(String text) {
    return Padding(
      padding: const EdgeInsets.fromLTRB(20, 100, 20, 100),
      child: Card(
        child: Text(text),
      ),
    );
  }

  final controller = PageController(
    viewportFraction: 0.75,
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.amber,
        appBar: AppBar(),
        body: SnappingPageScroll(
          controller: controller,
          children: <Widget>[
            customCard('Card 1'),
            customCard('Card 2'),
            customCard('Card 3'),
            customCard('Card 4'),
            customCard('Card 5'),
            customCard('Card 6'),
          ],
        ),
      ),
    );
  }
}
31
likes
130
pub points
72%
popularity

Publisher

verified publishersolidred.se

A plugin that allows you to make a pageView that scrolls a certain number of pages based on the scroll velocity, and then snaps to the nearest page.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on snapping_page_scroll