hisma_extra 0.1.1+9 copy "hisma_extra: ^0.1.1+9" to clipboard
hisma_extra: ^0.1.1+9 copied to clipboard

Extra classes on top of the Hisma hierarchical state machine implementation to simplify its usage.

example/hisma_extra_example.dart

import 'package:hisma/hisma.dart';
import 'package:hisma_extra/hisma_extra.dart';
import 'package:hisma_visual_monitor/hisma_visual_monitor.dart';

final machine = ToggleStateMachine(name: 'toggleMachine');

Future<void> play() async {
  while (true) {
    await Future<void>.delayed(const Duration(seconds: 1));
    await machine.toggle();
  }
}

void main(List<String> args) {
  StateMachine.monitorCreators = [
    (machine) => VisualMonitor(machine),
  ];

  machine.start();
  play();
}
0
likes
160
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

Extra classes on top of the Hisma hierarchical state machine implementation to simplify its usage.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

hisma

More

Packages that depend on hisma_extra