Skip to main content

vecta_state 1.0.0 copy "vecta_state: ^1.0.0" to clipboard
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.

0
likes
150
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

State machine engine for Vecta animation runtime.

License

MIT (license)

More

Packages that depend on vecta_state