Closed jamesdixon closed 2 years ago
Hey, thank you @jamesdixon 👍 We love to see our work helps others!
I didn't try myself, but as Flutter has a complete GestureDetector Widget I think it's doable.
Will do! If I get it working, I'll share here for others
Will do! If I get it working, I'll share here for others
Did you get it working already?
Just implemented it myself. Since the zoomNotifier is initialized with 0 we do need to add 1 in order for the multiplication to work. You need a variable, for example named double _previousScale;
to save the scale from the beginning of the zoom event.
return GestureDetector(
onScaleStart: (ScaleStartDetails details) {
_previousScale = _zoomNotifier.value + 1;
},
onScaleUpdate: (ScaleUpdateDetails details) {
double result = _previousScale * details.scale - 1;
if (result < 1 && result > 0) {
_zoomNotifier.value = result;
}
},
child: CameraAwesome(
zoom: _zoomNotifier,
...
),
);
Thanks @rohrz4nge, I added this feature to CamerAwesome :)
Hello! Awesome library. Kudos to your and your team.
Has anyone implemented pinch-to-zoom? I believe the primitives are there but curious if anyone has done it.
Cheers.