persistDefaultInstallerIcon function

String persistDefaultInstallerIcon(
  1. String dirPath
)

Persists the default installer icon to a file in the given directory.

Decodes a Base64-encoded icon string and writes it to a file in the system temp directory.

Returns the absolute path of the saved icon file.

Implementation

String persistDefaultInstallerIcon(String dirPath) {
  Directory(dirPath).createSync();
  final iconPath = p.join(dirPath, defaultInstallerIconFileName);
  final file = File(iconPath);
  Uint8List bytes = base64.decode(defaultInstallerIcon);
  file.writeAsBytesSync(bytes);
  return file.absolute.path;
}