saveIco static method

void saveIco(
  1. List<Icon> icons,
  2. String filePath
)

Save the resized image to a Windows ico file

Implementation

static void saveIco(List<Icon> icons, String filePath) {
  final image = Image(width: 256, height: 256);
  image.frames = icons.map((icon) => icon.image).toList();
  image.frameType = FrameType.sequence;

  final data = encodeIco(image);
  final file = File(filePath);
  file.createSync(recursive: true);
  file.writeAsBytesSync(data);
}