utils/yaml_utils
library
Functions
-
getDependencies(Map<String, dynamic>? pubspec)
→ List<String>
-
Extracts package names from dependencies section.
-
getDependencyVersions(Map<String, dynamic>? pubspec)
→ Map<String, String>
-
Extracts dependency with version info (string or map/path).
-
getDevDependencies(Map<String, dynamic>? pubspec)
→ List<String>
-
Extracts package names from dev_dependencies section.
-
getDevDependencyVersions(Map<String, dynamic>? pubspec)
→ Map<String, String>
-
Extracts dev_dependency versions.
-
parseLockFile(String path)
→ Map<String, String>?
-
Parses pubspec.lock and returns resolved package versions.
-
parsePubspec(String path)
→ Map<String, dynamic>?
-
Parses pubspec.yaml and returns a map of its contents.
-
removePackagesFromPubspec(String path, List<String> packagesToRemove, {bool fromDevDependencies = false})
→ bool
-
Removes packages from dependencies or dev_dependencies and writes updated pubspec.
Returns true if file was modified.