Initializing the camera Create a new file called camera_screen. dart and define the CameraScreen stateful widget inside it. The controller will help you access the different functionalities of the camera, but before using them, you have to initialize the camera. Create a new method called onNewCameraSelected() .