Flutter Framework - Refractored Camera Widget
I followed the instructions and it worked fine. The next step for me was to refactor the code so that the camera widget was in its own dart file.
How to Avoid Getting "LateInitializationError: Field 'controller' has not been initialized" Error
The key is to create async function to wait for the camera to be fully initialized and use it with the already written FutureBuilder.
Then use it in the build method like this:
Full Source Code of Camera Widget
For full source code of the camera.dart file: https://gist.github.com/kinmanlam/5755c821413844456e3033421e947772