Skip to content
pubscout

follow_the_leader

0.5.3, released 8 months ago by flutterbountyhunters.com

Widgets that follow other widgets using Leader and Follower links.

$ flutter pub add follow_the_leader
Source repository

What it does

Provides Leader and Follower widgets allowing designated widgets to follow the position, movement, and sizing of another widget on screen. Includes support for offsets, aligners, boundaries, and ordering containers.

AI-written summary of version 0.5.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a widget to track and follow the position of another widget independently of standard layouts.
  • You are implementing floating elements like tooltips, popovers, or floating toolbars that need precise positioning relative to a leader.

Skip it when

  • Standard layout widgets like Row, Column, or Stack can achieve your desired arrangement.
  • You do not have a leader-follower relationship between widgets.

Strengths

  • Allows follower widgets to bypass ancestor layout rules.
  • Supports custom aligners, boundaries, scaling, and keyboard-aware positioning.

Weaknesses

  • Requires careful ordering where Leader widgets must be built before their Followers.
  • Unusual mental model compared to standard Flutter tree-based layouts.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3
Leader(
  link: _leaderLink,
  child: YourLeaderWidget(),
);

Follower.withOffset(
  link: _leaderLink,
  offset: const Offset(0, -20),
  leaderAnchor: Alignment.topCenter,
  followerAnchor: Alignment.bottomCenter,
  child: YourFollowerWidget(),
);

Alternatives

Packages that do the same job and could replace follow_the_leader.

Works with

Packages commonly used together with follow_the_leader: ones it builds on, ones built on it, and its own family.