cameraIcon method

String? cameraIcon()

Implementation

String? cameraIcon() {
  if (cameraProgressInfo == null) {
    return null;
  }
  final purposes = cameraProgressInfo!.camera.purposes;

  if (purposes.contains(sdk.RouteCameraPurpose.noStoppingControl)) {
    return 'packages/$pluginName/assets/icons/navigation/dgis_camera_stop.svg';
  } else if (purposes.contains(sdk.RouteCameraPurpose.speedControl) ||
      purposes.contains(sdk.RouteCameraPurpose.averageSpeedControl)) {
    return switch (cameraProgressInfo!.camera.direction) {
      sdk.RouteCameraDirection.against =>
        'packages/$pluginName/assets/icons/navigation/dgis_camera_back.svg',
      sdk.RouteCameraDirection.along =>
        'packages/$pluginName/assets/icons/navigation/dgis_camera_front.svg',
      sdk.RouteCameraDirection.both =>
        'packages/$pluginName/assets/icons/navigation/dgis_camera_both.svg',
    };
  }

  return null;
}