partsForPath function Null safety

List<String> partsForPath(
  1. String path
)

Implementation

List<String> partsForPath(String path) {
  final parts = path.split('/');
  if (parts.first.startsWith('package:')) {
    // Convert dot separated package name into a path from which this package originated.
    parts.replaceRange(0, 1, parts.first.split('.'));
  }
  return parts;
}