Your first movement
This guide walks the full loop: author a movement in PoseFlow Studio,
save it as a .pose file, and run it in your app.
Plan to spend 20 minutes.
Prerequisites
-
A Flutter app with the SDK + Studio installed (installation).
-
A
StudioPersistencebundle wired up. The fastest way to get going is in-memory:import 'package:pose_flow_studio/pose_flow_studio.dart';final persistence = InMemoryStudioPersistence().bundle();For real apps you’ll plug in Firebase / Drift / SQLite, see building a Studio host.
1. Open the Studio
Wrap your route with StudioScope and
push PoseFlowStudioScreen:
StudioScope( persistence: persistence, child: const PoseFlowStudioScreen(),)You’ll land on the empty editor: a live camera fills the screen, floating panels hover on top.
2. Author a squat
The trainer’s workflow, repeat-able for any movement:
Step 1. Add phases
Open the Phases panel (left). Tap “Add phase”. Name it “Down”. Tap “Add phase” again, name it “Up”. You can drag-reorder; the phase order defines the cycle.
Step 2. Pick measurements
Open the Measurements panel (right). Either:
- Tap a preset chip at the top, e.g. “Knees deep”, to drop a curated condition into the current phase.
- OR tick a row in the channel list to enable that measurement manually. Channels are grouped by kind: joint angles, distances, ratios, position, velocity, stability.
For a squat, the simplest authoring is:
- Select the Down phase.
- Tap the “Knees deep” preset → drops a
left_knee∈ [70°, 110°] condition into the phase. - Select the Up phase.
- Tap the “Knees straight” preset → drops a
left_knee∈ [160°, 180°] condition.
Step 3. Verify the cycle
Stand in front of the camera. Squat down: the Down phase tile should light up with a thick green border (“active”) and the rep counter sits at 0. Stand back up: the Up phase activates, the counter ticks to 1. Repeat, every full down→up cycle counts a rep.
Step 4. Camera angles
Open the Camera angles panel. The header chip shows the live-detected angle (“Front · Hip” or “45° Left · Head” etc.). The 3 × 5 grid below it represents the orbit around the user. Tap a cell to set it as the authoring target, the cell with a filled fill is what the conditions you drop apply to.
For a basic squat, “Front · Hip” alone is enough. To author a view-dependent measurement (e.g. spine lean from the side), tap “90° Left · Hip” and re-drop the lean condition, the same condition can have different range bands per bucket, and the runtime picks whichever bucket the user actually stands in.
See camera buckets for the full model.
Step 5. Save
Top bar → click Save. The Studio writes:
- The
.posefile (JSON) into yourStudioPersistence.catalog. - A
studio_versions/{timestamp}snapshot for rollback. - The phase definitions into your
StudioPersistence.phases.
If you want to publish to a wider audience, click the dropdown next to
Save → Save & Publish. Same write but bumps status to
PUBLISHED so the consumer app’s library filters include it.
3. Load and run
In your app, grab the same Movement from your catalog and
hand it to TrackedMovementView:
final movement = await persistence.catalog.load('your-movement-id');
return TrackedMovementView( cameras: cameras, movement: movement!, onRepCompleted: (event) => print('Rep ${event.repNumber}!'),);The runtime initialises a MovementTracker
from the same .pose file the Studio just wrote. Phase transitions, rep
counts, form feedback events, all driven by the exact rules you
authored.
What you’ve learned
- Phases are the building blocks of every PoseFlow movement.
- Conditions on phases are evaluated per-frame against tracking points.
- A full traversal of a phase sequence counts a rep.
- Saving emits a
.posefile that any consumer can run unchanged.
Read next
- Phases, duration limits, ordering, naming.
- Measurements, every channel + when to use each.
- Conditions, range bounds, hold times, Δ-from-phase-entry.
- Phase sequences, pin a specific ordering, define alternatives (left + right lunge as one rep).