tiktoklikescroller 0.1.10 copy "tiktoklikescroller: ^0.1.10" to clipboard
tiktoklikescroller: ^0.1.10 copied to clipboard

outdated

A vertical fullscreen scroll implementation that snaps in place, similar to the TikTok app

Test

tiktoklikescroller #

A vertical fullscreen scroll implementation that snaps in place, similar to the TikTok app.

Demo #

Example at work

Usage #

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final List<Color> colors = <Color>[Colors.red, Colors.blue, Colors.green];

    return MaterialApp(
      home: Scaffold(
        body: TikTokStyleFullPageScroller(
          contentSize: colors.length,
          swipeThreshold: 0.2,
          // ^ the fraction of the screen needed to scroll
          swipeVelocityThreshold: 2000,
          // ^ the velocity threshold for smaller scrolls
          animationDuration: const Duration(milliseconds: 300),
          // ^ how long the animation will take
          onScrollEvent: _handleCallbackEvent,
          // ^ registering our own function to listen to page changes
          builder: (BuildContext context, int index) {
            return Container(
                color: colors[index],
                child: Text(
                  '$index',
                  style: const TextStyle(fontSize: 48, color: Colors.white),
                ),
              );
          },
        ),
      ),
    );
  }

  void _handleCallbackEvent(ScrollEventType type, {required int currentIndex}) {
  print("Scroll callback received with data: {type: $type, and index: $currentIndex}");
  }

}
216
likes
0
pub points
95%
popularity

Publisher

verified publisherdavidtaylor.io

A vertical fullscreen scroll implementation that snaps in place, similar to the TikTok app

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on tiktoklikescroller