occam library

Classes

OccamDebug
Opt-in lifecycle logging.
ParentState<T extends StateController>
A widget that reads a StateController owned by an ancestor StateWidget.
ParentStateElement<T extends StateController>
The Element backing every ParentState. Resolves the ancestor controller lazily on first build and caches it until deactivate.
Rx<T>
A plain reactive value. Build one with value.rx or Rx<T>(value).
RxBool
A reactive bool, with the logical operators a flag typically needs.
RxInterface<T>
Base type for every reactive value in occam: a ValueNotifier with the extra listener/stream bookkeeping from RxMixin.
RxList<T>
A reactive List. Behaves like a normal List<T> and notifies on any mutation (add, []=, remove, clear, removeWhere, addAll, length=, assignAll).
RxWidget<T>
The only widget that listens: rebuilds builder whenever notifier changes. Keep it as tight around the changing subtree as possible — that is the whole performance story of this package.
RxWidgetState<T>
State backing RxWidget. Subscribes in initState, resubscribes in didUpdateWidget when the notifier changes, and unsubscribes in dispose.
StateController<T extends StateWidget>
A State whose build() is forbidden — the widget builds instead, via StateWidget.build. Pair one with each StateWidget via createState.
StateElement
The Element backing every StateWidget. Passes its own controller into StateWidget.build and schedules StateController.readyState for the frame after mount.
StateWidget<T extends StateController<StateWidget>>
A StatefulWidget whose logic lives in a StateController.

Mixins

RxMixin<T>
Listener/stream bookkeeping shared by every Rx* type.

Extensions

Native on List<T>
Adds RxList.assignAll's in-place-replace convenience to plain lists too.
RxBoolExtension on bool
Shorthand to wrap a bool as a reactive RxBool: false.rx.
RxExtension on T
Shorthand to wrap any value as a reactive Rx: 1.rx, Model().rx.
RxListExtension on List<T>
Shorthand to wrap a List as a reactive RxList: <int>[].rx.