addPubRootDirectories method Null safety

  1. @protected
void addPubRootDirectories(
  1. List<String> pubRootDirectories
)
protected">@protected

Add a list of directories that should be considered part of the local project.

The local project directories are used to distinguish widgets created by the local project from widgets created from inside the framework or other packages.

Implementation

@protected
void addPubRootDirectories(List<String> pubRootDirectories) {
  pubRootDirectories = pubRootDirectories.map<String>((String directory) => Uri.parse(directory).path).toList();

  final Set<String> directorySet = Set<String>.from(pubRootDirectories);
  if(_pubRootDirectories != null) {
    directorySet.addAll(_pubRootDirectories!);
  }

  _pubRootDirectories = directorySet.toList();
  _isLocalCreationCache.clear();
}