active_observers 0.0.1 copy "active_observers: ^0.0.1" to clipboard
active_observers: ^0.0.1 copied to clipboard

outdated

A new way to create composable UI logic, inspired by React hooks.

active_observers #

A new way to create composable UI logic, inspired by React hooks.

Getting Started #

class TestObserveState extends StatefulWidget {
  TestObserveState();

  @override
  _TestObserveStateState createState() => _TestObserveStateState();
}

class _TestObserveStateState extends State<TestObserveState>
    with ObservableStateLifecycle<TestObserveState> { // 1. Add a mixin to your State
  @override
  initState() {
    super.initState();
    state = observeState('a', this); // 2. Call active observers in initState
  }

  ObserveState<String> state;

  @override
  Widget build(BuildContext context) {
    // 3. Get & set value. The widget will be automatically updated.
    return Text(state.value, textDirection: TextDirection.ltr);
  }
}

More observers are on the way.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A new way to create composable UI logic, inspired by React hooks.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, observable_state_lifecycle

More

Packages that depend on active_observers