overlapList method

Future<Image> overlapList(
  1. List<Image> others
)

Do merge image list. Overlaying the images

Implementation

Future<Image> overlapList(List<Image> others) {
  PictureRecorder recorder = PictureRecorder();
  final paint = Paint();
  Canvas canvas = Canvas(recorder);
  int totalWidth = width;
  int totalHeight = height;
  canvas.drawImage(this, Offset.zero, paint);
  for (var i in others) {
    totalWidth = max(totalWidth, i.width);
    totalHeight = max(totalHeight, i.height);
    canvas.drawImage(i, Offset.zero, paint);
  }
  return recorder.endRecording().toImage(totalWidth, totalHeight);
}