MainNavigationBloc<T> class
This Bloc
handles the main/top level navigation of this app. You can fire events in event.dart or use the functions in EventNavigation to call the functions indirectly.
This uses MainNavigationStrategy to decide which main navigations to accept and how to convert the T
to and from a String.
This also uses deepNavigationStrategyMap to have a mapping of DeepNavigationStrategys for each individual MainNavigation
that is allowed in the Bloc.
Defaults to home and will change the main navigation to home if it is attempted to change the app to an unknown state.
Constructors
-
defaultDeepNavigationStrategy is the strategy used when deepNavigationStrategyMap doesn't have a strategy for the
currentMainNavigationStrategy
Properties
-
blocUpdated
↔ List<
void Function()> -
Add functions to this to be ran when the
Bloc
is updated.getter/setter pairinherited -
no setter
-
getter/setter pair
-
getter/setter pair
-
final
-
final
-
getter/setter pair
- eventChannel → BlocEventChannel
-
Events that the UI fire to affect this
Bloc
are received through here.finalinherited -
getter/setter pair
-
This is the full navigation expressed as a String. The conversion function is provided by MainNavigationStrategy
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
strategy
→ MainNavigationStrategy<
T> -
final
-
undoStrategy
→ NavigationUndoStrategy<
T> -
final
Methods
-
Changes the current navigation to be equal to the
newFullNavigation
. -
Changes the main navigation to the
newMainNavigation
, if applicable. -
dispose(
) → void -
Disposes this value to save memory. Implementations should be idempotent.
inherited
- Will create a new DeepNavigationNode to assign to currentMainNavigation that starts from the base layer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
- Will attempt to pop the deep navigation node of currentMainNavigation. If currently at the base layer, this will do nothing.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateBloc(
) → void -
Signal that this
Bloc
has been updated. This will call all listeners added to blocUpdated.inherited -
updateBlocOnChange(
{required dynamic change(), required List tracker()}) → void -
Updates the
Bloc
after callingchange
if the value returned bytracker
changes.inherited -
updateBlocOnFutureChange(
{required Future change(), required List tracker()}) → Future< void> -
Updates the
Bloc
after callingchange
if the value returned bytracker
changes.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited