All Projects → sahandevs → xstate.dart

sahandevs / xstate.dart

Licence: MIT license
xstate for dart & flutter

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to xstate.dart

ember-statecharts
Statecharts for Ember.js applications
Stars: ✭ 67 (+116.13%)
Mutual labels:  statecharts, xstate
xstate-viz
Visualizer for XState machines
Stars: ✭ 274 (+783.87%)
Mutual labels:  state-management, xstate
use-router-machine
Router state-machine hook, powered by XState (DEPRECATED).
Stars: ✭ 11 (-64.52%)
Mutual labels:  statecharts, xstate
xstate-cpp-generator
C++ State Machine generator for Xstate
Stars: ✭ 33 (+6.45%)
Mutual labels:  state-management, xstate
xstate
State machines and statecharts for the modern web.
Stars: ✭ 21,286 (+68564.52%)
Mutual labels:  state-management, statecharts
xstate-react-router
XState connector to React Router.
Stars: ✭ 23 (-25.81%)
Mutual labels:  statecharts, xstate
XUI
XUI makes modular, testable architectures for SwiftUI apps a breeze!
Stars: ✭ 100 (+222.58%)
Mutual labels:  state-management
unstated
Simple state management for react
Stars: ✭ 12 (-61.29%)
Mutual labels:  state-management
NObservable
MobX like observable state management library with Blazor support
Stars: ✭ 66 (+112.9%)
Mutual labels:  state-management
almy
🗄️ 673 bytes store for managing the state in your application
Stars: ✭ 26 (-16.13%)
Mutual labels:  state-management
temperjs
State management for React, made simple.
Stars: ✭ 15 (-51.61%)
Mutual labels:  state-management
redux-interactions
Composing UI as a set of interactions
Stars: ✭ 22 (-29.03%)
Mutual labels:  state-management
flutter super state
A simple super state management library for Flutter (with async support)
Stars: ✭ 22 (-29.03%)
Mutual labels:  state-management
xsystem
Building Blocks for XState-based Actor Systems.
Stars: ✭ 40 (+29.03%)
Mutual labels:  xstate
snap-state
State management in a snap 👌
Stars: ✭ 23 (-25.81%)
Mutual labels:  state-management
nstate
A simple but powerful react state management library with low mind burden
Stars: ✭ 11 (-64.52%)
Mutual labels:  state-management
trux
Unidirectional data layer for reactive user interfaces
Stars: ✭ 59 (+90.32%)
Mutual labels:  state-management
asyncmachine
Relational State Machine with a visual inspector
Stars: ✭ 67 (+116.13%)
Mutual labels:  state-management
immutable-cursor
👊 Immutable cursors incorporating the Immutable.js interface over a Clojure-inspired atom
Stars: ✭ 58 (+87.1%)
Mutual labels:  state-management
rex-state
Convert hooks into shared states between React components
Stars: ✭ 32 (+3.23%)
Mutual labels:  state-management

xstate.dart pub package Dart CI

WIP xstate for dart & flutter

Example

CD Player:

final machine = Machine.fromJson({
  "key": "cd",
  "initial": "not_loaded",
  "states": {
    "not_loaded": {
      "on": {"INSERT_CD": "loaded"}
    },
    "loaded": {
      "initial": "stopped",
      "on": {"EJECT": "not_loaded"},
      "states": {
        "stopped": {
          "on": {"PLAY": "playing"}
        },
        "playing": {
          "on": {
            "STOP": "stopped",
            "EXPIRED_END": "stopped",
            "EXPIRED_MID": "playing",
            "PAUSE": "paused"
          }
        },
        "paused": {
          "initial": "not_blank",
          "states": {
            "blank": {
              "on": {"TIMER": "not_blank"}
            },
            "not_blank": {
              "on": {"TIMER": "blank"}
            }
          },
          "on": {"PAUSE": "playing", "PLAY": "playing", "STOP": "stopped"}
        }
      }
    }
  }
});

machine.start(); // not_loaded
machine.transition('not_loaded', 'INSERT_CD'); // loaded.stopped
machine.transition('loaded.paused', 'EJECT'); // not_loaded

Roadmap & Features

Core
  • Core FSM and functions. machine.start() , machine.transition(current, event) & state.matches('state')
  • Basic support for Hierarchical or Nested State Machines. State(child: Machine ...
  • Complete implementation of Statecharts (guards, context, ...)
  • Parallel State Machines
  • History States
  • Refrence by id. State(on: {"2": '#B'})
  • Machine.fromJson({}) ability to create machines with JSON Schema
  • Machine.fromSCXML('<></>') ability to create machines with SCXML
  • Binding package for flutter
  • Binding package for flutter_hook
  • Utility package for writing tests
  • More tests
Tooling
  • Run a webserver in watch mode and show all the machines in xstatejs's visualizer
Dart Analyzer Plugin
  • Show outline for a machine and its states

image

  • [Quick Fix] Convert Machine.fromJson({}) & Machine.fromSCXML('<></>') to Machine()
  • [Quick Fix] Convert Machine() to Machine.fromJson({}) or Machine.fromSCXML('<></>')
  • [Diagnostic] machine.maches('state.state_that_doesnt_exists') validation. (throw state_that_doesnt_exists doesn't exists on the machine)
  • [Diagnostic] Provide warning and errors when creating a machine for invalid transition, invalid paths and unused event and states.
  • [Quick Fix] Extract nested machines.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].