This recipe demonstrates how to use the camera plugin to display a preview,
take a photo, and display it using the following steps:

Add the required dependencies.

Get a list of the available cameras.

Create and initialize the CameraController.

Use a CameraPreview to display the camera’s feed.

Take a picture with the CameraController.

Display the picture with an Image widget.

1. Add the required dependencies

To complete this recipe, you need to add three dependencies to your app:

camera

Provides tools to work with the cameras on the device.

path_provider

Finds the correct paths to store images.

path

Creates paths that work on any platform.

dependencies

flutter

sdk

flutter

camera

path_provider