GitHub リポジトリhtsuruo/smooth_highlight

smooth_highlight

このパッケージを使用すると、ユーザーに何かを強調したい場合に、特定のウィジェットをハイライトアニメーションで目立たせることができます。

smooth_highlight のプロジェクト画像
スター
6
フォーク
2
最終プッシュ(UTC)
2024/09/01
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

Smooth Highlight

You can emphasize a specific widget by highlight animation when you want to emphasize something to your users. As you can see from the following samples, you can use smooth_highlight in any widget.

And also, you can use ValueChangeHighlight that is useful when you simply want to highlight only the text changes(refer to Sample2). It is inspired by the Cloud Firestore value change animation in the Firebase console.

Sample1 Sample2 Sample3

Usage

You just wrap SmoothHighlight in your widget.

SmoothHighlight(
  // set your custom color
  color: Colors.yellow,
  child: Text('Highlight'),
);

and you can also define custom behavior.

SmoothHighlight(
  // highlight in initState phase.
  useInitialHighLight: true,

  // Set custom duration.
  duration: const Duration(seconds: 1),

  // highlight whenever count is even.
  enabled: count % 2 ==0,
);
ValueChangeHighlight

If you want to highlight the widget only the value changed, ValueChangeHighlight is useful. It requires highlight trigger value.

ValueChangeHighlight(
  // highlight if count changes
  value: count,
  color: Colors.yellow,
  child: Text('count: $count'),
);

if you don't want to highlight a specific values, disableFromValues property prevents it.

ValueChangeHighlight(
  value: count,

  // disable highlight if count changes from `null` or `2` to some value.
  // In this counter example, `0`, `3`, won't be highlighted.
  disableFromValues: const [null, 2],
);

UseCase

Following gif is Firestore GUI in Firebase Console. Firestore realtime listener is powerful, but it is hard for your user to see what value changed. You can make the user notice by highlighting the changed value. It's probably a user-friendly consideration, I think.

Hideki Tsuruoka GitHub avatar
GitHub 作者

Hideki Tsuruoka ↗

Software Enginner - Flutter / Dart / Firebase

言語DartHTMLSwiftKotlin

カテゴリー

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件

  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}
  • flutter_lints開発用^2.0.0

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗