toError method
Attempts to convert the result to Error.
Implementation
Result<T> toError({Object? error, StackTrace? stackTrace, T? data, DateTime? lastUpdate}) {
return Error(
error: error ?? ResultNotifierException(message: 'Unknown'),
stackTrace: stackTrace,
data: data ?? this.data,
lastUpdate: lastUpdate ?? DateTime.now(),
);
}