run method
Starts the job and returns a Future that completes with either the result of the job or an error if the job did not finish successfully.
Implementation
Future<T> run() {
switch (status) {
case JobStatus.notStarted:
case JobStatus.paused:
final isStarted = start();
if (isStarted) {
return _jobDoneCompleter!.future;
} else {
return Future<T>.error(
ArcGISException._(message: 'Job failed to start.'),
);
}
case JobStatus.started:
return _jobDoneCompleter!.future;
case JobStatus.succeeded:
return Future.value(result!);
case JobStatus.failed:
return Future.error(error!);
case JobStatus.canceling:
return Future<T>.error(
ArcGISException._(message: 'Job has been canceled.'),
);
}
}