Skip to content
pubscout

scroll_animator

0.3.0, released 2 years ago by kamilszczek.pl

Smooth, animated scrolling for mouse wheels, trackpads, keyboards, and programmatic scrolls.

WASM-ready
$ flutter pub add scroll_animator
Source repository

What it does

Provides smooth scroll animations ported from Chromium for mouse wheels, trackpads, keyboards, and programmatic scrolls in Flutter. It includes built-in curves like ChromiumEaseInOut and ChromiumImpulse, alongside controllers and actions to handle customized scroll animations dynamically.

AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want smooth scrolling behavior on desktop or web resembling Chromium browsers.
  • You need keyboard and programmatic scrolls to animate smoothly with automatically calculated durations.
  • You want custom physics-based scroll animations for trackpads and mouse wheels.

Skip it when

  • You only need the default platform-specific Flutter scroll physics.
  • You are building a mobile-first app where custom desktop/web scroll behaviors are unnecessary.

Strengths

  • Ported directly from Chromium for identical browser-like smooth scrolling behavior.
  • Handles both precise trackpads and coarse mouse wheels uniformly.
  • Supports keyboard shortcut integrations via custom ScrollIntent actions.

Weaknesses

  • Global usage with AnimatedPrimaryScrollController requires care if multiple scrollables share the primary controller.
  • Limited documentation outside of the provided example code.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Not documented

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

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) => MaterialApp(
        home: AnimatedPrimaryScrollController(
          animationFactory: const ChromiumEaseInOut(),
          child: Scaffold(
            body: ListView.builder(
              itemCount: 100,
              itemBuilder: (context, index) => ListTile(
                title: Text('Item $index'),
              ),
            ),
          ),
        ),
      );
}

Alternatives

Packages that do the same job and could replace scroll_animator.