relativizePath function Null safety

String relativizePath(
  1. String input
)

Dart Analysis Server returns paths in absolute form so we must to relativize it

Implementation

String relativizePath(String input) {
  if (input.startsWith(Directory.current.path)) {
    return input.replaceFirst('${Directory.current.path}/', '');
  }

  return input;
}