initializePlacements method

List<SignaturePlacement> initializePlacements({
  1. required int count,
  2. required int currentPage,
  3. double baseScale = 0.6,
})

Initializes a list of SignaturePlacement objects.

count → number of signatures to place. currentPage → the page where the signatures should be added. baseScale → scale of the signatures (default = 0.6).

Each signature is placed with a constant gap so they don’t overlap.

Implementation

List<SignaturePlacement> initializePlacements({
  required int count,
  required int currentPage,
  double baseScale = 0.6,
}) {
  final placements = <SignaturePlacement>[];
  const double gap = 24.0;

  for (int i = 0; i < count; i++) {
    placements.add(
      SignaturePlacement(
        offsetDx: 40 + i * gap,
        offsetDy: 120 + i * gap,
        page: currentPage,
        scale: baseScale,
      ),
    );
  }
  return placements;
}