DC<Error, Data> class
Data channel could be used to transport data across the dart program Data channel can move any data ranging from external http api response to internal data.
Constructors
- DC({required Error? error, required Data? data})
- DC.data(Data? data)
-
returns just data
factory
- DC.error(Error error)
-
returns the error
factory
- DC.forward(DC _dc, Data? data)
-
forwards the error if present else forwards the data
factory
Properties
- data ↔ Data?
-
getter/setter pair
- error ↔ Error?
-
getter/setter pair
- hasData → bool
-
checks whether data is available
no setter
- hasError → bool
-
checks whether an error is present
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pick(
{dynamic onError(Error error)?, dynamic onNoError(Data? data)?, dynamic onData(Data data)?, dynamic onNoData()?}) → void - Cherry pick values
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited