pike library

Classes

Carp<State>
Abstract class Carp that extends PikeBase and manages state updates.
Change<Event, State>
Represents a change in state triggered by an event.
MultiPikeProvider
A widget that allows combining multiple PikeProviders into a single widget tree.
Pike<Event, State>
Abstract class Pike that manages state and event handling.
PikeBase<State>
Base class that manages state and provides mechanisms for observing events, state changes, and lifecycle hooks.
PikeBuilder<P extends PikeBase<S>, S>
A widget that listens to a PikeBase instance, and rebuilds the UI using the provided builder function when the state changes.
PikeConsumer<P extends PikeBase<S>, S>
A widget that listens to a Pike instance and rebuilds based on state changes. It provides a builder function to update the UI and a listener to react to state changes.
PikeListener<P extends PikeBase<S>, S>
A widget that listens for state changes in a Pike instance.
PikeObserver
Base class for observing the lifecycle and behavior of PikeBase instances.
PikeProvider<T extends PikeBase<Object?>>
A custom InheritedWidget that provides access to a Pike instance of type T to the widget tree.

Typedefs

Emit<S> = void Function(S state)
Type alias for emitting new state of type State.
EventHandler<Event, State> = FutureOr<void> Function(Event event, Emit<State> emit)
Type alias for the event handler function. This function takes an Event and an Emit function to update the State.
PikeBuilderWidget<S> = Widget Function(BuildContext, S)
A function type that defines a builder widget, which takes a BuildContext and a state of type S and returns a Widget.
PikeBuilderWidgetWhen<S> = bool Function(S newState, S oldState)
A function type that defines a condition to determine when the builder should be triggered based on the old and new state.
PikeWidgetListener<S> = void Function(BuildContext context, S state)
Type for a widget listener that takes a BuildContext and the current S state.
PikeWidgetListenerWhen<S> = bool Function(S newState, S oldState)
Type for a conditional listener that checks whether the state change should be listened to.