disposeCamera method
Disposes the camera and releases all resources.
This will stop the camera preview, face detection, and release ML Kit resources.
Call this method when you want to manually stop the camera.
Implementation
Future<void> disposeCamera() async {
if (_onDisposeCamera != null) {
_onDisposeCamera!();
} else {
debugPrint(
'LivenessCheckController: Dispose callback not registered. '
'Make sure the controller is attached to LivenessCheckScreen.',
);
}
}