パッケージ、リポジトリ、アプリカテゴリを検索

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アプリを開発する開発者
  • 一貫した読み込みUXを必要とするチーム
  • ネイティブプラットフォーム統合を回避するプロジェクト
  • ロードインジケータの最小限のセットアップを必要とするアプリ
  • 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

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。