addSticker method
StickerAsset
addSticker(
- Sticker sticker, {
- double? angle,
- StickerConstraint? constraint,
- StickerPosition? position,
- StickerSize? size,
- 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;
}