实际上,我已经构建了自定义相机并拍摄了照片,并绘制了线条,但是我不知道如何在捕获的照片上添加表情符号,并使其可移动和缩放。
实际上我将所有表情符号都放在了字符串类型列表中,
List<String> emojiUrls=[/*Urls of Emojis*/ ];
并将它们显示在按钮内的简单对话框中,
主体:
Stack(
children: <Widget>[
new Container(
decoration: BoxDecoration(
image: DecorationImage(
image:FileImage(File(widget.imagePath)),
fit: BoxFit.cover
)
),
child: GestureDetector(
onPanUpdate: (DragUpdateDetails details){
setState(() {
RenderBox object=context.findRenderObject();
Offset localPosition=object.globalToLocal(details.globalPosition );
points=new List.from(points)..add(localPosition);
});
},
onPanEnd: (DragEndDetails details)=>points.add(null),
child: new CustomPaint(
painter: new Painter(points: points),
size:Size.infinite ,
),
),
foregroundDecoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(getIndexOfStickerId)
)
),
),
Positioned(
top: 0.0,
left: 0.0,
child: IconButton(
icon: Icon(Icons.delete, size: 40.0,color: Colors.red,),
onPressed: (){},
),
)
],
)