搜尋套件、儲存庫與 APP 分類

swipe_refresh 封面
套件詳情v1.1.2

swipe_refresh

一組小部件透過下拉動作提供重新整理功能。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
4240
喜歡數
98
Pub 分數
150

安裝套件

flutter pub add swipe_refresh

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

SwipeRefresh 是一個 Flutter 套件,提供小部件以在可滾動列表和其他內容中啟用下拉刷新功能。它透過允許使用者使用自然手勢刷新內容來提升使用者體驗,常見於具有動態資料的資訊流或清單類應用。該套件支援 Android、iOS、Web、macOS、Windows 和 Linux 等多個平台,確保在不同裝置上行為一致。它可無縫整合至現有的滾動檢視中,並提供可自訂的指示器與刷新觸發器。

適用情境

  • 刷新列表數據
  • 更新來源內容
  • 下拉加載新項目
  • 增強可滾動視圖中的使用者體驗
  • 在儀表板中實現下拉刷新

主要特色

  • 下拉手勢支援
  • 可自訂的刷新指示器
  • 跨平台相容性
  • 與 ScrollViews 的輕鬆整合
  • 可設定的重新整理觸發時機
  • 刷新時的平滑動畫

適合對象

  • 開發動態列表的開發者
  • 需要即時資料更新的應用程式
  • 以使用者體驗為導向的行動與網頁應用程式
  • 需要在跨平台環境中保持一致刷新模式的項目
  • 重視直覺式使用者互動的團隊

使用建議

  • 可能需要額外的狀態管理
  • 使用複雜的重新整理邏輯帶來的效能影響
  • 複雜刷新動畫的自訂功能有限
  • 不適合非滾動內容
  • 依賴於在可滾動容器內的正確使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Swipe Refresh

Build Status Coverage Status Pub Version Pub Likes Pub popularity Flutter Platform

Overview

Widget for refresh by swipe.

  • :1234: Enabled on every platform - the package is fully written on Flutter side and enabled on every platform.
  • :recycle: Fully covered by tests - guaranteeing the result and expectations from this package.
  • :notebook_with_decorative_cover: End-to-end documentation - every aspect of implementation is documented, so there is full understanding.
  • :cow2: Support from the best Flutter experts - we are open to any enhancement ideas and contributions.

material cupertino

Main classes:

  1. Refresh state
  2. Widget for indicate swipe refresh
  3. Widget for indicate swipe refresh Material style
  4. Widget for indicate swipe refresh Cupertino style

Example

Material

Refresh indicator widget with Material Design style.

SwipeRefresh.material(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Cupertino

Refresh indicator widget with Cupertino Design style.

SwipeRefresh.cupertino(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Adaptive

Refresh indicator widget with adaptive to platform style.

SwipeRefresh.adaptive(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Builder

Refresh indicator widget with adaptive to platform style, and with SliverChildBuilderDelegate in childDelegate(so as not to create more child elements than are visible through Viewport).

SwipeRefresh.builder(
  stateStream:  Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  itemCount: Colors.primaries.length,
  itemBuilder: (context, index) {
return Container(
 ...
   );
 },
),

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}

Installation

Add swipe_refresh to your pubspec.yaml file:

dependencies:
  swipe_refresh: $currentVersion$

At this moment, the current version of swipe_refresh is swipe_refresh version.

Changelog

All notable changes to this project will be documented in this file.

Issues

To report your issues, submit them directly in the Issues section.

Contribute

If you would like to contribute to the package (e.g. by improving the documentation, fixing a bug or adding a cool new feature), please read our contribution guide first and send us your pull request.

Your PRs are always welcome.

How to reach us

Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.

Telegram

License

Apache License, Version 2.0

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。