Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't stop the live prediction phase (the pauseLivePrediction method is not implemented on iOS), and closeCamera() doesn't work. #67

Open
skynicolettid opened this issue Oct 17, 2024 · 1 comment

Comments

@skynicolettid
Copy link

I can't stop the live prediction part in the dispose() method of the widget. Even if I navigate to a new page, the camera remains active (high CPU usage), and if I call "await controller.closeCamera()", it doesn't complete. How can I correctly release all the resources before navigating to a new page? Thanks.

P:S all the Steaming are correctly closed.

@skynicolettid
Copy link
Author

Found the issue:
This set of code in MethodCallHandler.swit in case of method with no parameters exit on return and the closeClamera() is not reached:

public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
guard let args = call.arguments as? [String: Any] else {
return
}

We can use this code:

public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
    
    let args = call.arguments as? [String: Any] ?? [:]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant