CallOutcome<T> class

CallOutcome

This class holds the two possible outcomes of a function call an exception and a successful data response to be returned to the calling function.

The object of CallOutcome can be type casted with

Both data and exception cannot be null at the same object.

Constructors

CallOutcome({T? data, Exception? exception})
Constructor of the class which accepts two arguments data and exception Please it is compulsory to provide at least one of the two argument. Else an assertion is made resulting in compilation error.

Properties

data ↔ T?
data member of the class is a general purpose member with datatype
getter/setter pair
exception Exception?
exception member takes in a value of type Exception. If you have your own exception of string format to be passed it this way to return it:
getter/setter pair
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
toString() String
A string representation of this object.
inherited

Operators

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