简体   繁体   中英

Can you pass camera through multiple widgets in Flutter

Is there any way to pass the CameraController between widgets in Flutter? My app requires the camera to be on multiple pages for the user to preview their recording and align objects. all the ways I have tried to pass the camera between pages has led to the application crashing on a physical device (ie initializing the camera on the first page and passing it between pages, creating a separate class for the camera to display the camera preview.)

Is there a Provider I can use?

Thanks!

You will make the CameraController static and when you are going to use it in another page you wil call it this way: CameraController.class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM