我正在尝试在 custompainter 上绘制图像。我正在使用颤振 custompainter 视频上的示例,这就是我目前所拥有的。我可以在图像中绘图,但无法缩放图像。如何在手势上缩放图像并在图像中绘制?我宁愿不使用任何包。
Container(
height: double.infinity,
width: double.infinity,
color: Colors.black87,
child: FittedBox(
child: GestureDetector(
onScaleStart: _scaleStartGesture,
onScaleUpdate: _scaleUpdateGesture,
onScaleEnd: (_) => _scaleEndGesture(),
child: SizedBox(
height: _image.height.toDouble(),
width: _image.width.toDouble(),
child: CustomPaint(
willChange: true,
painter: ImagePainter(
image: _image,
points: points
),
),
),
),
),
),