【发布时间】:2019-01-23 21:59:03
【问题描述】:
我需要在图片上做一些类似贴纸的事情。 我希望它可拖动、可缩放和可旋转。 颤振有可能吗?
我发现类可拖动 https://stackoverflow.com/a/53957707/1984747
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Positioned(
left: position.dx,
//top: position.dy - height + 20,
child: Draggable(
child: Container(
width: width,
height: height,
color: Colors.blue,
child: Center(child: Text("Drag", style: Theme.of(context).textTheme.headline,),),
),
feedback: Container(
child: Center(
child: Text("Drag", style: Theme.of(context).textTheme.headline,),),
color: Colors.red[800],
width: width,
height: height,
),
onDraggableCanceled: (Velocity velocity, Offset offset){
setState(() => position = offset);
},
),
),
],
);
}
请给点提示。
【问题讨论】:
标签: image dart flutter draggable scalable