VtjCommandResult<T> class

Available extensions
Annotations
  • @freezed

Constructors

VtjCommandResult.failure(String error, int? statusCode)
const
factory
VtjCommandResult.success(T data)
const
factory

Properties

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

Methods

map<TResult extends Object?>({required TResult success(_Success<T> value), required TResult failure(_Failure<T> value)}) → TResult

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? success(_Success<T> value)?, TResult? failure(_Failure<T> value)?}) → TResult?

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult success(_Success<T> value)?, TResult failure(_Failure<T> value)?, required TResult orElse()}) → TResult

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult success(T data)?, TResult failure(String error, int? statusCode)?, required TResult orElse()}) → TResult

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult success(T data), required TResult failure(String error, int? statusCode)}) → TResult

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? success(T data)?, TResult? failure(String error, int? statusCode)?}) → TResult?

Available on VtjCommandResult<T>, provided by the VtjCommandResultPatterns extension

A variant of when that fallback to returning null

Operators

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