follow-app-development
Installation
SKILL.md
Develop Flutter apps with Follow
Use the public package:follow/follow.dart API. Check the app's resolved Follow version before using an API: shell branches and built-in transitions require Follow 0.5.0 or newer. For details, consult the README and example/lib/src/ of the matching Follow package source. In a Follow source checkout, these are at the repository root. An installed copy of this skill may live outside that checkout, so do not resolve package documentation relative to this SKILL.md.
Structure features and dependencies
- Describe each area with an immutable
Feature. Declare itsbindingsand choose eitherroutesorshell.Feature.builderwraps content in UI or providers; it does not create a navigation stack. - Start the root with
FollowApp(feature: ..., builder: (_, config) => MaterialApp.router(routerConfig: config)). UseFeatureScopefor a local feature only when it declares neitherroutesnorshell. - Register dependencies with
Bind.value,Bind.factory,Bind.singleton, orBind.async. An unnamedToken<T>()is the default key for that exact type. Create named tokens once and reuse the same instances when multiple bindings share a type. ChooseActivationandAsyncPolicyaccording to when a binding must be ready; do notwatcha factory binding. - Render the supplied
childin a feature builder, oroutletin a shell builder, exactly once. Keep wrappers inside the intended feature scope.
Define and navigate routes
- Use
StaticRouteSpecfor destinations without data andDataRouteSpec<T>with a decoder and encoder for typed data. Route paths are absolute. Build pages withFeatureRoute.pageand mount child features withFeatureRoute.mount. - Navigate through
context.follow.push,replace, orgowith a location produced by a route spec; usepopto return. Keep URL serialization in the spec so deep links and browser history can reconstruct route data. - Put access decisions in typed guards. Handle allow, deny, and redirect outcomes without creating redirect loops.