slugFromAPIUrl function Null safety

RepositorySlug slugFromAPIUrl(
  1. String url
)

Implementation

RepositorySlug slugFromAPIUrl(String url) {
  final split = url.split('/');
  final i = split.indexOf('repos') + 1;
  final parts = split.sublist(i, i + 2);
  return RepositorySlug(parts[0], parts[1]);
}