MyoroRequest<T> class
Model representing a state where data being fetched via FutureOr function.
- Annotations
-
- @immutable
- @myoroModel
Constructors
- MyoroRequest.new({MyoroRequestEnum status = statusDefaultValue, String errorMessage = errorMessageDefaultValue, T? data})
-
const
- MyoroRequest.fake({T? data})
-
factory
Properties
- data → T?
-
Data generated from
final
- errorMessage → String
-
Error message when status is MyoroRequestEnum.error.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
self
→ MyoroRequest<
T> -
no setterinherited
- status → MyoroRequestEnum
-
Status of the request.
final
Methods
-
copyWith(
{MyoroRequestEnum? status, String? errorMessage, T? data, bool dataProvided = true}) → MyoroRequest< T> -
createErrorState(
String errorMessage) → MyoroRequest< T> -
createIdleState(
) → MyoroRequest< T> -
createLoadingState(
) → MyoroRequest< T> -
createSuccessState(
T? data) → MyoroRequest< T> -
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
Constants
- errorMessageDefaultValue → const String
- statusDefaultValue → const MyoroRequestEnum