Search packages, repositories and app categories

Package detailsv2.1.1

scrolls_to_top

A dart package for working with scrolls-to-top iOS feature. Easy to use

AndroidiOSWebmacOSWindowsLinux
30-day downloads
35.7K
Likes
59
Pub points
160

Install package

flutter pub add scrolls_to_top

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The scrolls_to_top package simplifies implementing the iOS scroll-to-top gesture in Flutter applications across multiple platforms. It enables developers to easily add and manage the pull-to-refresh-like behavior where scrolling up from the top of a scrollable widget triggers a scroll-to-top action. Designed with simplicity in mind, it integrates seamlessly into existing scrollable widgets without requiring complex setup. Ideal for apps aiming to replicate native iOS scroll behaviors on Android and other platforms.

Use cases

  • Implementing iOS-style scroll-to-top gestures
  • Enhancing user experience in scrollable lists
  • Adding platform-specific behaviors in cross-platform apps
  • Improving navigation in long content screens
  • Supporting consistent UX across iOS and non-iOS platforms

Key features

  • Simple integration with Scrollable widgets
  • Cross-platform compatibility
  • Minimal boilerplate code
  • Automatic handling of scroll-to-top logic
  • Configurable trigger thresholds

Suitable for

  • Developers targeting iOS-like interactions
  • Cross-platform app creators
  • UX-focused Flutter projects
  • Apps with long scrollable content
  • Teams prioritizing native feel on multiple platforms

Considerations

  • May require additional styling for visual feedback
  • Behavior might differ slightly on non-iOS platforms
  • Not needed for apps without scroll-to-top expectations
  • Limited customization beyond basic trigger settings
  • Best used in conjunction with RefreshIndicator for full functionality

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Scrolls to top

pub package

A dart package for working with scrolls-to-top iOS feature

Why is this needed? This is necessary for those cases when you have several nested Scaffolds or you need to distinguish the tap event in the status bar from other scroll events

Usage

Just wrap any widget with ScrollsToTop and provide onScrollsToTop argument

  @override
  Widget build(BuildContext context) {
    return ScrollsToTop(
      onScrollsToTop: _onScrollsToTop,
      scaffold: Scaffold(
        appBar: AppBar(title: const Text('Scroll to top')),
        body: Container(),
      ),
    );
  }

  Future<void> _onScrollsToTop(ScrollsToTopEvent event) async {
    //TODO: Your code
  }

Warning

  • You need to have at least one Scaffold in your application
  • If you use several Navigators, the tap events will come only to the widgets inside the main Navigator

Categories

Source repository

Projects using this package