Skip to content

SDK overview

package:pose_flow is the runtime SDK, pose detection, movement tracking, rep counting, form analysis. It’s a Flutter plugin (Android + iOS native; web via WASM Web Worker; macOS via package:camera on Apple Silicon).

The authoring side (PoseFlow Studio) ships as a separate package (package:pose_flow_studio) that depends on this one. Consumer apps that only count reps depend on the runtime package alone; hosts that embed the authoring UI (a CMS, a trainer dashboard) depend on both.

Two barrel files

import 'package:pose_flow/pose_flow.dart';

The full SDK, includes the native Flutter widgets (TrackedMovementView, PoseCameraView, etc.). Use this on mobile / desktop targets.

import 'package:pose_flow/pose_flow_core.dart';

The web-safe subset, everything except the camera widgets and the native plugin surface. Use this in web-only consumers OR in shared code paths where the camera comes from another source.

The mental model

┌────────────────────────────────┐
│ Movement │ ← .pose file in memory
│ (model) │
└──────────────┬─────────────────┘
│ tracker.load(movement)
v
┌─────────────────┐ ┌────────────────────────────────┐
│ Pose │ -> │ MovementTracker │ -> TrackingResult / frame
│ (per frame, │ │ - PhaseStateMachine │ -> RepCompletedEvent stream
│ display- │ │ - rep counter + scoring gate│ -> FormFeedbackEvent stream
│ space) │ │ - FormServiceV2 │
└─────────────────┘ │ - CameraAngleDetector │
▲ │ - FrameValidator │
│ └────────────────────────────────┘
┌─────────────────┐
│ PoseSource │ (NativePoseSource by default ,
│ (camera / │ the FFI bridge to the pure-C
│ replay / etc) │ pose engine in package:blaze_flow)
└─────────────────┘

What you’ll use most

The 80/20 surface, almost every consumer reaches for these:

TypeRole
MovementThe in-memory .pose model. Always start by loading one.
TrackedMovementViewThe drop-in widget that does camera + pose + tracking.
MovementTrackerThe orchestrator. Mount it directly when you need fine-grained control.
LoadMovementArgsThe canonical builder for tracker init args. Always use this rather than calling load by hand.
TrackingResultThe per-frame result from processFrame.
RepCompletedEventStreamed on every completed rep.
FormFeedbackEventStreamed on every triggered form rule.

What’s underneath

The parts you DON’T need to touch unless you’re customising:

TypeRole
PoseSourceAbstraction for “where do poses come from”. Default: NativePoseSource.
NativePoseSourceThe FFI bridge to the pure-C pose engine in package:blaze_flow.
PhaseStateMachinePhase transition machine. Picks rule-based OR vector-matching mode based on the loaded Movement, see Rep counting.
FormServiceV2Per-frame form-rule evaluator. Consumed inside MovementTracker; see FormRule for the inputs.
CameraAngleDetector / StableCameraAngleDetector16-bucket camera-angle classification, see CameraAngleDetector.
FrameValidatorVisibility + distance gates.
AngleExtractorJoint angle computation from landmarks.
PipelineTimingReportPer-frame perf breakdown surfaced by PoseCameraView.onPipelineTiming.

Models

The pure-data types you’ll serialise / round-trip:

TypeNotes
MovementTop-level movement document.
PoseOne detected pose: 33 landmarks + visibility + optional world coords.
Landmark2D point with visibility.
PoseFrameA pose with a name (used in recorded reference frames).
PhaseConfigOne phase + its transitions.
TrackingPointOne measurement channel.
FormRuleOne form rule.
FormFeedbackCue payload: text + optional audio / haptic.
RepDetectionConfigHow a rep is counted.
RepScoringConfigOptional rep-quality gate.
TrackingResultPer-frame tracker output.
MovementConfigRuntime config-overlay, swap tracking points / phases / form rules at load time.
CameraBucketOne of 16 canonical buckets.
CameraAngleHigh-level enum: front / side / any.

Authoring helpers (for tools, not the runtime)

package:pose_flow/pose_flow.dart exports the authoring catalogue used by PoseFlow Studio:

TypeRole
MovementIntentsCurated preset list, “knees deep”, “stance wide”, etc.
MovementValidatorLints a Movement for common authoring mistakes.
AngleDefinitions, DistanceDefinitions, RatioDefinitions, PositionDefinitions, VelocityDefinitions, StabilityDefinitionsPer-kind channel catalogues that drive the Studio’s measurement picker.
CameraBucketsThe canonical 16-bucket ring.
ScoringProfileInferrerDerives default scoring bands from sample reps.

These are NOT needed for runtime tracking; they’re for tools that need to know “what channels can I author against?”.

The Studio wrapper

package:pose_flow_studio adds one runtime piece on top of this SDK:

TypeRole
ShowcaseTrackerThin facade over MovementTracker with a ValueNotifier<TrackingFrame> for ergonomic per-frame UI subscription. Used by every Studio + showcase + CMS surface.

Consumer apps that only play back authored movements don’t need the Studio package, they use MovementTracker directly via TrackedMovementView.