loadImages method

Future<void> loadImages(
  1. List<Uint8List> imageFiles
)

Implementation

Future<void> loadImages(List<Uint8List> imageFiles) async {
  images.clear();
  for (var i = 0; i < imageFiles.length; i++) {
    ImageItem image = ImageItem();
    final imageLoaded = await image.load(imageFiles[i]);
    images.add(imageLoaded);
    screenshotControllers.addAll({i: ScreenshotController()});
    layers.addAll({
      i: [BackgroundLayerData(image: imageLoaded)]
    });

    undoLayers.addAll({currentIndex: []});
    removedLayers.addAll({currentIndex: []});
    setState(() {});
  }

  setState(() {});
}