Created
June 22, 2020 23:21
-
-
Save Ramko9999/a1a5eb0a6bfcd4e7a78c70088f1b956d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> setupCamera() async { | |
try{ | |
List<CameraDescription> cameras = await availableCameras(); | |
_camera = CameraController(cameras[0], ResolutionPreset.low); | |
await _camera.initialize(); | |
if(mounted){ | |
setState(() { | |
_isCameraInitialized = true; | |
}); | |
_camera.startImageStream(runOnFrame); | |
} | |
} | |
catch(e, s){ | |
print(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment