BlocStates class

BlocStates serves as a container of dynamic objects (usually bloc states). It is part of the MultiBlocProvider package and therefore mainly used to provide a varety of bloc states via the MultiBlocBuilder._builder function.

A bloc states can be retrieved via the get method and the wanted type like this:

final exampeState = blocStates.get<ExampleState>();

Constructors

BlocStates.new(List states)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get<T>() → T
Retrieves the first object that matches the generic or null if no machting object available. NOTE: Please ensure that BlocStates doesn't contain multiple objects of the same type.
getState<T>(int index) → T
if you have multiple objects of save type you can use this final state = states.getState
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited