savePackageConfig function

Future<void> savePackageConfig(
  1. PackageConfig configuration,
  2. Directory directory
)

Writes a package configuration to the provided directory.

Writes .dart_tool/package_config.json relative to directory. If the .dart_tool/ directory does not exist, it is created. If it cannot be created, this operation fails.

Also writes a .packages file in directory. This will stop happening eventually as the .packages file becomes discontinued. A comment is generated if [PackageConfig.extraData] contains a "generator" entry.

Implementation

Future<void> savePackageConfig(
        PackageConfig configuration, Directory directory) =>
    writePackageConfigJsonFile(configuration, directory);