stop method
Stop recording and get the video file path
Implementation
Future<String?> stop() async {
if (!_isRecording) {
debugPrint('[WidgetRecorder] ⚠️ Not recording');
return null;
}
debugPrint('[WidgetRecorder] ⏹️ Stopping recording...');
_isRecording = false;
_timer?.cancel();
try {
await _channel.invokeMethod('stopRecording');
debugPrint('[WidgetRecorder] ✅ Video saved: $_outputPath');
onComplete?.call(_outputPath ?? '');
return _outputPath;
} catch (e) {
debugPrint('[WidgetRecorder] ❌ Error stopping: $e');
_handleError(e.toString());
return null;
}
}