StickerLayerData.fromMap constructor
Implementation
factory StickerLayerData.fromMap(
Layer layer,
Map map,
List<Uint8List> stickers,
) {
int stickerPosition = map['listPosition'] ?? -1;
Widget sticker = kDebugMode
? Text(
'Sticker $stickerPosition not found',
style: const TextStyle(color: Colors.red, fontSize: 24),
)
: const SizedBox.shrink();
if (stickers.isNotEmpty && stickers.length > stickerPosition) {
sticker = ConstrainedBox(
constraints: const BoxConstraints(minWidth: 1, minHeight: 1),
child: Image.memory(
stickers[stickerPosition],
),
);
}
return StickerLayerData(
flipX: layer.flipX,
flipY: layer.flipY,
offset: layer.offset,
rotation: layer.rotation,
scale: layer.scale,
sticker: sticker,
);
}