endlich 0.1.0-beta.2 copy "endlich: ^0.1.0-beta.2" to clipboard
endlich: ^0.1.0-beta.2 copied to clipboard

Finite State Machine

example/lib/example.dart

library example;

import 'package:freezed_annotation/freezed_annotation.dart';

import 'package:endlich/endlich.dart';

part 'example.g.dart';
part 'example.freezed.dart';

@Endlich()
@freezed
class TestState with _$TestState {
  @Endlich.initial()
  @Endlich.state(effect: 'inFoo')
  factory TestState.foo(
    int count,
    @Endlich.event(Bar) void Function(int incr) next,
  ) = Foo;

  @Endlich.state(effect: 'inBar')
  factory TestState.bar(
    int count,
    @Endlich.event(Baz) void Function(int incr) next,
  ) = Bar;

  @Endlich.state(effect: 'inBaz')
  factory TestState.baz(
    int count,
    @Endlich.event(Foo) void Function(int incr) next,
  ) = Baz;
}
0
likes
120
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

Finite State Machine

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection, freezed_annotation, mobx

More

Packages that depend on endlich