CallOutcome<T> constructor
CallOutcome<T> ({
- 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.
Implementation
CallOutcome({this.data, this.exception})
:
/// Checking if both the member fields are not initialised with null
assert(
data != null || exception != null,
"Both data and exception can't be empty",
);