setNavigationRoadBlock static method

void setNavigationRoadBlock(
  1. int length, {
  2. int startDistance = -1,
  3. TaskHandler? taskHandler,
})

Cancel the active navigation.

Set a roadblock on the current route having the length specified in meters starting from the current GPS position.

Parameters

  • IN length The length specified in meters.
  • IN startDistance The distance from start where the roadblock begins, defaults to -1 meaning the current navigation position.
  • IN navigationListener Navigation listener used to identify the navigation session.

Throws

  • An exception if it fails.

Implementation

static void setNavigationRoadBlock(
  final int length, {
  final int startDistance = -1,
  final TaskHandler? taskHandler,
}) {
  taskHandler as TaskHandlerImpl?;

  staticMethod(
    'NavigationService',
    'setNavigationRoadBlock',
    args: <String, dynamic>{
      'length': length,
      'startDistance': startDistance,
      'navigationListener': taskHandler?.id ?? 0,
    },
  );
}