addSticker method

StickerAsset addSticker(
  1. Sticker sticker, {
  2. double? angle,
  3. StickerConstraint? constraint,
  4. StickerPosition? position,
  5. StickerSize? size,
  6. double? scale,
})

sticker tapped

Implementation

StickerAsset addSticker(
  Sticker sticker, {
  double? angle,
  StickerConstraint? constraint,
  StickerPosition? position,
  StickerSize? size,
  double? scale,
}) {
  final assets = StickerAsset(
    id: uuid(),
    sticker: sticker,
    angle: angle ?? 0.0,
    constraint: constraint ?? const StickerConstraint(),
    position: position ?? const StickerPosition(),
    size: size ?? const StickerSize(),
    scale: scale ?? 1.0,
  );
  value = value.copyWith(
    assets: List.of(value.assets)..add(assets),
    selectedAssetId: assets.id,
  );
  return assets;
}