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

套件詳情v2.0.0

flutter_overlay_loader

一個簡單的 Flutter 套件,用於在取得遠端資料或任何長時間執行的非同步任務時管理覆蓋式載入。Flutter 覆蓋載入器易於使用。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
8580
喜歡數
111
Pub 分數
150

安裝套件

flutter pub add flutter_overlay_loader

套件介紹

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

一個輕量級的 Flutter 套件,專為在非同步操作(例如取得遠端資料)期間顯示覆蓋式載入器而設計。它提供了一種簡單且可自訂的方式,在現有 UI 元素上方顯示載入指示器,而不會破壞佈局。載入器可輕鬆切換開關,非常適合在長時間執行的任務中改善使用者體驗。以簡潔為設計核心,能順暢整合至跨多個平台的應用程式中。

適用情境

  • 在 API 呼叫期間顯示載入覆蓋層
  • 顯示資料同步過程中的進度
  • 增強表單提交期間的使用者體驗
  • 管理列表刷新時的加載狀態
  • 在背景處理期間提供視覺反饋

主要特色

  • 用於顯示/隱藏載入器的簡單 API
  • 可自定的覆蓋層外觀
  • 支援所有主要的 Flutter 平台
  • 所需的樣板程式碼最少
  • 輕鬆整合非同步工作流程

適合對象

  • 尋求快速載入 UI 解決方案的開發者
  • 需要一致載入反饋的應用程式
  • 頻繁進行網路請求的專案
  • 重視開發人員效率的團隊
  • 跨平台應用

使用建議

  • 可能需要手動管理狀態
  • 與高級載入器相比,自訂選項有限
  • 不適合複雜的加載動畫
  • 依賴於正確的上下文處理
  • 最好在有清晰的載入邏輯的情況下使用

原始 README

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

Build Passing Pub Version Pub Likes Pub Points Pub Popularity GitHub forks GitHub stars GitHub issues GitHub followers Twitter GitHub license

flutter_overlay_loader

A simple Flutter package for managing loader when fetching remote data or any long running async task. Flutter overlay loader is easy to use. You can show loader using only write two lines of code.

Overlay loader without overlaying Appbar

drawing drawing

Overlay Loader without overlaying BottomAppBar and also overlaying AppBar

drawing

Getting Started

Installing

dependencies:
  flutter_overlay_loader: ^1.0.8
Import
import 'package:flutter_overlay_loader/flutter_overlay_loader.dart';

How To Use

When start network call then call this line of code..

Loader.show(context,progressIndicator:LinearProgressIndicator());

After finished network call then call :

Loader.hide();

You can customize this loader..

Loader.show(context,
  isSafeAreaOverlay: false,
  isBottomBarOverlay: false,
  overlayFromBottom: 80,
  overlayColor: Colors.black26,
  progressIndicator: CircularProgressIndicator(backgroundColor: Colors.red),
  themeData: Theme.of(context)
    .copyWith(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.green))
);

You can also check loader is showing or not using the property : Loader.isShown and you can prevent back pressed like this snippet:

WillPopScope(
  child: //TODO , 
  onWillPop:()async => !Loader.isShown
)

Finally dispose call hide method on dispose method :

@override
void dispose() {
  Loader.hide();

  super.dispose();
}

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。