scrolls_to_top 2.1.1 copy "scrolls_to_top: ^2.1.1" to clipboard
scrolls_to_top: ^2.1.1 copied to clipboard

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

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
46
likes
160
points
13.9k
downloads

Publisher

verified publisheroptimist.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on scrolls_to_top