addManifestNodeToParent method

  1. @override
Future<void> addManifestNodeToParent(
  1. String manifestFileType,
  2. ManifestNode parent,
  3. ManifestNode node
)
override

Implementation

@override
Future<void> addManifestNodeToParent(
  String manifestFileType,
  ManifestNode parent,
  ManifestNode node,
) async {
  var manifest = getManifest(manifestFileType);
  // parent.add(node);
  var result = manifest.filterBy(parent)[0];
  result.add(node);
  if (!manifestFiles.containsKey(manifestFileType)) {
    throw Exception(
      "Manifest file for type $manifestFileType not found",
    );
  }
  manifestFiles[manifestFileType]!.writeAsStringSync(manifest.toXml());
}