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

load 封面
套件詳情v1.0.0

load

全域載入組件,純Flutter程式庫,不使用原生程式碼。其用法類似於OKToast。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1940
喜歡數
22
Pub 分數
130

安裝套件

flutter pub add load

套件介紹

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

一個輕量級的純 Flutter 加載組件套件,提供全域加載指示器,不依賴原生程式碼。使用方式受到 OKToast 的啟發,為跨應用顯示加載狀態提供簡單且一致的方式。相容所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。非常適合尋求在非同步操作期間管理 UI 級加載指示器的開發者。

適用情境

  • 在 API 呼叫期間顯示載入覆蓋層
  • 顯示資料獲取過程中的進度
  • 增強長時間執行任務期間的使用者回饋
  • 在各個平台上提供一致的加載體驗
  • 用全域解決方案取代手動載入小工具

主要特色

  • 全域載入控制
  • 純 Dart 實現
  • 跨平台支援
  • 類似 OKToast 的簡單 API
  • 無原生程式碼依賴

適合對象

  • 開發跨平台 Flutter 應用的開發者
  • 需要一致載入使用者體驗的團隊
  • 專案避免原生平台整合
  • 需要最少設定即可載入指示器的應用程式
  • 以UI為中心的應用程式,包含頻繁的異步操作

使用建議

  • 如果未妥善處理,可能需要手動關閉
  • 與高級吐司庫相比,自訂選項有限
  • 不適合複雜的加載動畫或嵌套的加載狀態

原始 README

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

load

pub package GitHub

Global loading widget, which can be used through simple configuration.

Pure flutter library, not use native code.

It is similar to OKToast in use.

ScreenShot

Screenshot_2019-05-21-14-08-42-731_com.example.ex.png

Usage

  • install

Add to yaml

version is pub package

dependencies:
  load: $latest_version
  • import
import 'package:load/load.dart';
  • wrap your application
void main() {
  runApp(
    LoadingProvider(
      child: MyApp(),
    ),
  );
}

or

LoadingProvider(
  child: MaterialApp(),
);

Debug custom loading widget in Flutter inspector

You can try to use next method to include the widget:

MaterialApp(
  builder: (context, widget) {
    return LoadingProvider(
      child: widget,
    );
  },
);

see example/lib/main.dart

  • show or hide dialog
showLoadingDialog();
showCustomLoadingWidget(Container()); // custom dialog
hideLoadingDialog();

Advanced Usage

Custom Loading Widget

Using LoadingThemeData and loadingWidgetBuilder

LoadingProvider(
  themeData: LoadingThemeData(),
  loadingWidgetBuilder: (ctx, data) {
    return Center(
      child: SizedBox(
        width: 30,
        height: 30,
        child: Container(
          child: CupertinoActivityIndicator(),
          color: Colors.blue,
        ),
      ),
    );
  },
  child: MyApp(),
);

image

Custom some config

All params is optional

Params Type Default Value Desc
backgroundColor Color Colors.black54 Background transparent mask
tapDismiss bool true Will it close when touching the background?
loadingBackgroundColor Color Colors.white Background color for the center Loading Widget
loadingPadding EdgeInsets EdgeInsets.all(8.0) Padding for the center Loading Widget
loadingSize Size Size(55,55) Size for the center Loading Widget
animDuration Duration Duration(milliseconds: 300) Show/Hide Time Duration

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。