state_buddy 1.0.1 copy "state_buddy: ^1.0.1" to clipboard
state_buddy: ^1.0.1 copied to clipboard

The simplest state manager around for dart and flutter

state budy #

as simple state manager

class CounterManager extends Manager<int>{
    CounterManager():super(0);

    void increment() => emit(state++);
}

void main(){
    //Add the manager to the ManagerTable to make it accesible throughout the entire application
    ManagerTable.addManager(CounterManager());
    //you can find the manager in the table like this
    final manager = ManagerTable.find<CounterManager>();
    //print the state every time it changes
    manager.addListener((state) => print(state));
    //this will print 1
    manager.increment();
    //this will print 2
    manager.increment();
}

0
likes
120
pub points
0%
popularity

Publisher

unverified uploader

The simplest state manager around for dart and flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on state_buddy