title: Zoom camera in Flutter
body: <p>I'm using this lib for displaying a camera (<a href="https://pub.dev/packages/camera" rel="nofollow noreferrer">https://pub.dev/packages/camera</a>), however, I'd like to set a predefined zoom value for the camera before it starts, but I'm not able to identify where I can set it using this lib.</p>
  
  <p>Does anyone know how to do it?</p>
  
  <p>Here's the code I got so far</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'dart:async';
  import 'package:flutter/material.dart';
  import 'package:camera/camera.dart';
  
  class CameraPage extends StatefulWidget {
    @override
    _CameraPageState createState() =&gt; _CameraPageState();
  }
  
  class _CameraPageState extends State&lt;CameraPage&gt; {
    List&lt;CameraDescription&gt; cameras;
    CameraController controller;
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
  
      buscarCameras();
    }
  
    Future&lt;void&gt; buscarCameras() async {
      cameras = await availableCameras();
      controller = CameraController(cameras[0], ResolutionPreset.medium);
      controller.initialize().then((_) {
        if (!mounted) {
          return;
        }
        setState(() {});
      });
  
  
  }
  
    @override
    Widget build(BuildContext context) {
  
      if(controller == null || controller.value == null)
        return Center(
          child: CircularProgressIndicator(),
        );
  
      if (!controller.value.isInitialized) {
        return Container();
      }
      return AspectRatio(
          aspectRatio: controller.value.aspectRatio,
          child: CameraPreview(controller));
    }
  }
  </code></pre>