vecta_state 1.0.0
vecta_state: ^1.0.0 copied to clipboard
State machine engine for Vecta animation runtime.
vecta_state #
State machine engine for the Vecta animation framework. Manages animation states and transitions declaratively.
Features #
- Declarative state machine definitions
- Event-driven state transitions
- Transition blending with configurable duration
- Wildcard transitions (
*) - Pure Dart -- no Flutter dependency
Getting started #
dependencies:
vecta_state: ^1.0.0
Usage #
import 'package:vecta_state/vecta_state.dart';
final machine = StateMachine(
name: 'main',
initialState: 'idle',
states: {
'idle': StateDef(animation: 'idleBreath'),
'walking': StateDef(animation: 'walkCycle'),
},
transitions: [
TransitionDef(from: 'idle', to: 'walking', on: 'walk'),
TransitionDef(from: 'walking', to: 'idle', on: 'stop'),
],
);
machine.send('walk'); // transitions to 'walking'
Additional information #
Part of the Vecta monorepo. See the main repository for full documentation.