FLUTTER ECOSYSTEM

optimist-dev/scrolls_to_top

iOS のスクロールトップ機能を扱うためのDartパッケージ

トップにスクロール のプロジェクト画像
Stars
22
Forks
11
最終プッシュ(UTC)
2024/03/15
プロジェクト状態
公開中
Optimist GitHub avatar
GITHUB Organization

Optimist ↗

言語DartHTMLSwiftKotlinObjective-C

技術トピック

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件
  • flutter{"sdk":"flutter"}
  • flutter_lints開発用^2.0.3
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

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

https://github.com/optimist-dev/scrolls_to_top/blob/main/arts/example.gif?raw=true

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