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

パッケージ詳細v0.5.3

follow_the_leader

他のウィジェットに続くウィジェット。

AndroidiOS
30日間ダウンロード
4万
いいね数
37
Pub ポイント
150

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

flutter pub add follow_the_leader

パッケージ概要

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

Flutterパッケージで、ウィジェットが画面内の他のウィジェットの位置を動的に追跡できるようにします。ツールチップ、フローティングインジケーター、またはターゲットウィジェットの動きを追跡するアニメーションオーバーレイなどのインタラクティブUI要素を作成するのに最適です。パフォーマンスとシンプルさを重視して設計されており、AndroidおよびiOSプラットフォームでシームレスに動作します。パッケージはFlutterのレンダリングパイプラインを効率的に活用し、カクつきのないスムーズなアニメーションを実現します。応答性のある視覚フィードバックによりユーザー体験を向上させたい開発者に最適です。

用途

  • 動的ツールチップの作成
  • コンテンツを追跡するフローティングアクションボタンの構築
  • アニメーションオーバーレイの設計
  • ガイド付きツアーの実施
  • カーソルまたは選択パスの可視化

主な機能

  • リアルタイムウィジェットトラッキング
  • スムーズなアニメーション統合
  • クロスプラットフォーム互換性
  • 最小限のボイラープレート
  • 最小限のオーバーヘッドで効率的なレンダリング

適している対象

  • インタラクティブ要素を探しているUI/UXデザイナー
  • ガイド付きオンボーディングフローを構築する開発者
  • 動的な視覚フィードバックを必要とするアプリ
  • 洗練されたモバイル体験に注力するチーム

注意事項

  • 多数のトラッキング対象ウィジェットがあるとパフォーマンスに影響する可能性があります
  • 重なりを避けるために正確な配置が必要です
  • 静的レイアウトには適していません
  • 低性能デバイスでのテストが必要です
  • 軽量なターゲットウィジェットと併用するのが最適です

元の README

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

Follow the Leader - Widgets following widgets

Built by the Flutter Bounty Hunters


Getting Started

Select a widget that you want to follow and wrap it with a Leader widget. Give the Leader widget a LeaderLink, to share with Followers.

Leader(
  link: _leaderLink,
  child: YourLeaderWidget(),
);

Add a widget that you want to follow your Leader, and wrap it with a Follower widget.

// Follower appears 20px above the Leader.
Follower.withOffset(
  link: _leaderLink,
  offset: const Offset(0, -20),
  leaderAnchor: Alignment.topCenter,
  followerAnchor: Alignment.bottomCenter,
  child: YourFollowerWidget(),
);

Follower's can position themselves with a constant distance from a Leader using .withOffset(), as shown above. Or, Follower's can choose their exact location on every frame by using .withAligner().

// Follower appears where the aligner says it should.
Follower.withAligner(
  link: _leaderLink,
  aligner: _aligner,
  child: YourFollowerWidget(),
);

To constrain where your Follower is allowed to appear, pass a boundary to your Follower.

// Follower is constrained by the given boundary.
Follower.withAligner(
  link: _leaderLink,
  aligner: _aligner,
  boundary: _boundary,
  child: YourFollowerWidget(),
);

Building multiple widgets without layouts

Building follower widgets is a bit unusual with Flutter. Typically, whenever we build multiple widgets in Flutter, we place them in a layout container, such as Column, Row, or Stack. But follower widgets don't respect ancestor layout rules. That's the whole point.

follow_the_leader introduces a new container widget, which builds children, but doesn't attempt to apply any particular layout rules. The primary purpose of this widget is to make it clear to readers that you aren't trying to layout the children.

BuildInOrder(
  children: [
    MyContentWithALeader(),
    Follower.withOffset(),
    Follower.withDynamics(),
  ],
);

The BuildInOrder widget builds each child widget in the order that it's provided. This fact is important because Leader widgets must be built before their Followers. But BuildInOrder does not impose any Offset on its children. BuildInOrder passes its parent's constraints down to the children.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

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