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

flutter_progress_hud 封面
套件詳情v2.0.2

flutter_progress_hud

高度可自訂的模態進度指示器,帶有漸變動畫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.9萬
喜歡數
131
Pub 分數
150

安裝套件

flutter pub add flutter_progress_hud

套件介紹

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

一個高度可自訂的Flutter模態進度指示器,顯示帶有平滑淡入淡出動畫的載入覆蓋層。它提供了一種簡單的方法來在非同步操作期間顯示和隱藏載入狀態,透過指示進行中的過程來改善使用者體驗。HUD 可以透過不同的訊息、顏色和形狀進行自訂,並支援多種平台,包括行動裝置、Web 和桌面。非常適合用於表單、API 呼叫或任何需要視覺反饋的操作。

適用情境

  • 在API請求期間顯示加載狀態
  • 顯示表單提交進度
  • 增強資料擷取過程中的使用者體驗
  • 在後台任務期間提供反饋
  • 在長時間運行的操作中指示處理狀態

主要特色

  • 淡入與淡出動畫
  • 可自定義的訊息和外觀
  • 支援多個平台
  • 簡單的顯示/隱藏方法
  • 可設定的覆蓋顏色與不透明度
  • 跨裝置的響應式設計

適合對象

  • 開發頻繁使用非同步操作的應用程式之開發者
  • 注重用戶體驗的團隊
  • 需要一致加載指示器的項目
  • 針對多個平台的應用
  • 需要精緻回饋的UI密集型應用程式

使用建議

  • 可能需要仔細管理,以避免與其他UI元素重疊
  • 自定選項可能會增加簡單用例的複雜性
  • 對非常頻繁的顯示/隱藏循環的效能影響
  • 不適用於非模態載入場景
  • 與第三方替代方案相比,內建主題有限

原始 README

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

pub package

Flutter Progress HUD

Highly customizable modal progress indicator with fade animation.

Preview

Usage

Wrap with ProgressHUD the widget on top of which you want to show the modal indicator.

ProgressHUD(
  child: HomePage(),
)

Get a reference of ProgressHUD

final progress = ProgressHUD.of(context);

Show indeterminate progress

progress.show();

Or a progress with text

progress.showWithText('Loading...');

Then dismiss

progress.dismiss();

Example (full)

ProgressHUD(
        child: Builder(
          builder: (context) => Center(
                child: Column(
                  children: <Widget>[
                    RaisedButton(
                      child: Text('Show for a second'),
                      onPressed: () {
                        final progress = ProgressHUD.of(context);
                        progress.show();
                        Future.delayed(Duration(seconds: 1), () {
                          progress.dismiss();
                        });
                      },
                    ),
                    RaisedButton(
                      child: Text('Show with text'),
                      onPressed: () {
                        final progress = ProgressHUD.of(context);
                        progress.showWithText('Loading...');
                        Future.delayed(Duration(seconds: 1), () {
                          progress.dismiss();
                        });
                      },
                    ),
                  ],
                ),
              ),
        ),
      ),

Customization

Attribute Name Default Value Description
indicatorColor Colors.white When using the default indicator widget, this is how you set its color
indicatorWidget A basic CircularProgressIndicator Custom indicator widget
backgroundColor Colors.black54 Indicator background color
backgroundRadius Radius.circular(8.0) Indicator background radius
borderColor Colors.white Indicator background border color
borderWidth 0.0 Indicator background border width
barrierEnabled true You can disable the modal barrier if you want to allow touches while the progress is shown
barrierColor Colors.black12 Color of the Barrier displayed behind the indicator
textStyle TextStyle(color: Colors.white, fontSize: 14.0) TextStyle for the Text displayed below the indicator
padding EdgeInsets.all(16.0)} Indicator content padding

所屬分類

原始碼儲存庫

使用此套件的專案