isCalculationRunning static method

bool isCalculationRunning(
  1. TaskHandler taskHandler
)

Checks if a route calculation is still in progress.

Queries whether the calculation identified by the given TaskHandler is currently running. Returns false if the calculation has completed (either successfully or with an error), was cancelled, or if the handler is invalid.

Useful for UI state management (e.g., showing/hiding progress indicators) or deciding whether cancellation is necessary. Check this before calling cancelRoute to avoid unnecessary operations.

Parameters

Returns

  • true if the calculation is currently in progress.
  • false if the calculation has finished, was cancelled, or handler is invalid.

See also:

Implementation

static bool isCalculationRunning(final TaskHandler taskHandler) {
  taskHandler as TaskHandlerImpl;

  final OperationResult result = staticMethod(
    'RoutingService',
    'isCalculationRunning',
    args: taskHandler.id,
  );
  return result['result'];
}