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

loading_indicator のカバー
パッケージ詳細v4.0.2

loading_indicator

純粋なDartで書かれたロードアニメーションのコレクション。追加の依存関係なしにすぐに利用可能。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
7.2万
いいね数
695
Pub ポイント
160

パッケージをインストール

flutter pub add loading_indicator

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Dartで完全に実装されたさまざまなローディングアニメーションを提供する軽量なFlutterパッケージです。外部の依存関係を必要とせず、スムーズでカスタマイズ可能なローディングインジケータを提供します。Android、iOS、Web、macOS、Windows、Linuxをサポートしており、複数のプラットフォームでのアプリケーションにおけるローディング状態の表示に最適です。統合および使用が簡単で、非同期処理中のユーザー体験を向上させるのにぴったりです。

用途

  • フォームでの読み込み状態の表示
  • データ取得中の進行状況を表示する
  • ページ遷移中のUIの向上
  • バックグラウンドタスクでの視覚フィードバックの提供
  • カスタム読み込み画面の作成

主な機能

  • 純粋な Dart 実装
  • 追加の依存関係なし
  • クロスプラットフォーム対応
  • 複数のアニメーションスタイル
  • カスタマイズが簡単
  • 軽量サイズ

適している対象

  • シンプルな読み込みUI
  • 複数のプラットフォームをターゲットにするアプリ
  • 外部ライブラリを避ける開発者
  • モバイルおよびWebアプリのUI向上
  • 既存のプロジェクトへの迅速な統合

注意事項

  • 基本的な読み込みアニメーションに限定
  • 色とサイズ以外の高度なカスタマイズオプションはありません
  • 低スペックのデバイスではアニメーションのパフォーマンスが十分でない可能性があります
  • 複雑な読み込みロジックには適していません
  • 組み込みのエラーまたは成功状態が欠けている

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

LoadingIndicator

pub package GitHub top language

A collection of out of the box loading animations written in pure dart, no extra dependency, inspired by loaders.css and NVActivityIndicatorView.

Demo

Now, you can click this site to preview.3D effect will be invalid in web.

Animation types

Type Type Type Type
1. ballPulse 2. ballGridPulse 3. ballClipRotate 4. squareSpin
5. ballClipRotatePulse 6. ballClipRotateMultiple 7. ballPulseRise 8. ballRotate
9. cubeTransition 10. ballZigZag 11. ballZigZagDeflect 12. ballTrianglePath
13. ballTrianglePathColored 14.ballTrianglePathColoredFilled 15. ballScale 16. lineScale
17. lineScaleParty 18. ballScaleMultiple 19. ballPulseSync 20. ballBeat
21. lineScalePulseOut 22. lineScalePulseOutRapid 23. ballScaleRipple 24. ballScaleRippleMultiple
25. ballSpinFadeLoader 26. lineSpinFadeLoader 27. triangleSkewSpin 28. pacman
29. ballGridBeat 30. semiCircleSpin 31. ballRotateChase 32. orbit
33. audioEqualizer 34. circleStrokeSpin

Installing

Install the latest version from pub

Preparing a release

Use the release helper from the latest master checkout to calculate the next version from the existing stable tags and update the root pubspec.yaml and CHANGELOG.md:

./scripts/prepare_release.sh --dry-run
./scripts/prepare_release.sh patch

patch, minor, and major are supported, as well as an explicit version such as 4.0.2. The helper refreshes tags from origin and ignores local tags that no longer exist remotely. It accepts a release tag that is either in the current history or fully represented by cherry-picked commits, and refuses to continue when the latest tag cannot be matched to the current history. For an automatic patch, it asks GitHub for notes before changing files and copies the returned Markdown into the dated changelog entry. A real patch run (not --dry-run) requires a clean master matching origin/master, updates only the root pubspec.yaml and CHANGELOG.md, commits them, pushes master, creates and pushes the next version tag, and invokes gh release create with the generated notes. It does not modify example/pubspec.yaml. gh must be installed and authenticated. The existing tag-triggered workflow safely skips release creation when the script has already created it. minor, major, and explicit versions update the local root pubspec.yaml and CHANGELOG.md with a placeholder, then print the release-notes command.

Usage

Simple but powerful parameters

LoadingIndicator(
  indicatorType: Indicator.ballPulse, // Required: animation type
  colors: const [Colors.white],        // Optional: color collection
  strokeWidth: 2,                      // Optional: stroke and line width
  backgroundColor: Colors.black,       // Optional: widget background
  pathBackgroundColor: Colors.black,   // Optional: stroke background
)

strokeWidth controls the bar width of lineScale, lineScaleParty, lineScalePulseOut, lineScalePulseOutRapid, and lineSpinFadeLoader. When omitted, these indicators keep their original size-derived bar width.

Without a controller, every indicator plays continuously. To control playback, create and dispose a LoadingIndicatorController with your widget:

late final LoadingIndicatorController _controller;

@override
void initState() {
  super.initState();
  _controller = LoadingIndicatorController();
}

@override
void dispose() {
  _controller.dispose();
  super.dispose();
}

@override
Widget build(BuildContext context) {
  return LoadingIndicator(
    indicatorType: Indicator.ballScaleMultiple,
    controller: _controller,
  );
}

The controller works with all 34 animation types:

_controller.pause(); // Freeze the current frame immediately.

await _controller.pauseAt(0.5); // Pause the next time progress reaches 50%.

await _controller.pauseAt(
  1.0,
  behavior: LoadingIndicatorPauseBehavior.jumpToTarget,
); // Advance the complete animation group to the target and pause now.

_controller.resume();

progress is the normalized position (0.0 to 1.0) of an indicator's reference animation track: 0.0 is the start of a loop and 1.0 is its final frame before reset. pauseAt completes only after the indicator has paused. Replacing a pending command or disposing the controller completes that Future with LoadingIndicatorCommandCanceled. One controller can be attached to only one LoadingIndicator at a time; the last command sent while detached is applied on the next attachment.

Migrating from 3.x

Version 4.0 removes the pause widget parameter. Replace it with a controller:

// 3.x
LoadingIndicator(indicatorType: Indicator.ballPulse, pause: isPaused);

// 4.0
LoadingIndicator(
  indicatorType: Indicator.ballPulse,
  controller: controller,
);

void setPaused(bool isPaused) {
  isPaused ? controller.pause() : controller.resume();
}

中文版

License

Copyright 2019 Tino Guo.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

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