app_state library
A routing library and state management solution on top of Router API for larger apps.
Instead of routes or widgets, in the core there is a stack of stateful objects (Blocs, ChangeNotifiers, or anything else, collectively referred to as page states as opposed to widget states). This package translates navigation intents to operations on those. The page states are then wrapped into widgets to form the navigator's stack. This simplifies state management: no need for providers, stateful widgets, manual bloc creation and disposal, or BuildContext.
Classes
-
CStatelessMaterialPage<
P extends PagePath, R> - CurrentPageStackChangedEvent
- MaterialPageStacksRouterDelegate
- Builds the root Navigator which is set to always show only one page with child for its widget.
-
PAbstractMaterialPage<
P extends PagePath, R> -
PAbstractPage<
P extends PagePath, R> - The base page class for this package.
- PageEvent
- The base class for PPageStateMixin events.
- PagePath
- Describes a location within the app, corresponds to location + state. Can be used to navigate to a page recovering its state. Subclass this for your pages' paths.
- PagePathChangedEvent
- Emit this when the path of the screen changes (location or state).
-
PagePopEvent<
R> - Emit this for PageStack to remove and dispose the page.
- PageStackBackButtonDispatcher
- PageStackConfiguration
- Used to recover PagePath objects, can be serialized for browser history.
- Builds a Navigator using PPageStack.pages.
- PageStackRouteInformationParser
- PageStackRouterDelegate
- PageStacks
- A container for PageStack objects with a concept of a current one.
- PageStacksBackButtonDispatcher
- The back button dispatcher for PageStacks, directs requests to the current bloc in the stack.
- PageStacksBuilder
- Widget that builds itself when stacks emits events.
- PageStacksConfiguration
- Used to restore PageStacks state, can be serialized for browser history.
- PageStacksEvent
- The base class for PageStacks events.
- PageStacksRouteInformationParser
- PageStacksRouterDelegate
-
PPageStack<
P extends PagePath> - The source of pages for Navigator widget.
-
PPageStackEvent<
P extends PagePath> - The base class for PPageStack events.
-
PPageStackPageEvent<
C extends PagePath, R> - An PageStackEvent that carries the pageEvent of the specific page.
-
PPageStacksStackEvent<
P extends PagePath> - A PageStackEvent that carries the pageStackEvent of the specific stack.
-
PPageState<
P extends PagePath, R> - The default implementation of PPageStateMixin.
-
PPageStatefulBloc<
P extends PagePath, S, R> - A PPageStateMixin implementation for your pages that uses a simple custom BLoC implementation.
-
PStatefulMaterialPage<
P extends PagePath, R, S extends PPageStateMixin< P, R> > - The base class for stateful pages.
- SingleEntryOverlay
- An Overlay with a single initial OverlayEntry.
-
StatefulBlocWidget<
R, B extends CPageStatefulBloc< PagePath, S, R> , S>
Enums
- BackPressedResult
- DuplicatePageKeyAction
- What to do if pushing a page with a key already existing in the stack.
- PageStackMatchMode
- How to match PAbstractPage objects with PagePath objects in PPageStack.setConfiguration and PPageStack.replacePath.
- PopCause
Mixins
-
PPageStateMixin<
P extends PagePath, R> - Makes the stateful objects that back your screens aware of the page stacking.
Typedefs
-
AbstractPage<
R> = PAbstractPage< PagePath, R> -
CPageStatefulBloc<
P extends PagePath, S, R> = PPageStatefulBloc< P, S, R> -
PageStack
= PPageStack<
PagePath> -
PageStackEvent
= PPageStackEvent<
PagePath> -
PageStackPageEvent<
R> = PPageStackPageEvent< PagePath, R> -
PageStacksStackEvent
= PPageStacksStackEvent<
PagePath> -
PageState<
R> = PPageState< PagePath, R> -
PageStatefulBloc<
S, R> = CPageStatefulBloc< PagePath, S, R> -
PageStateMixin<
R> = PPageStateMixin< PagePath, R> -
StatefulMaterialPage<
R, S extends PageStateMixin< R> > = PStatefulMaterialPage<PagePath, R, S> -
StatelessMaterialPage<
R> = CStatelessMaterialPage< PagePath, R>