title: How to get the actual aspect ratio of the video?
body: <p>I don't want my video to look stretched. I'm using <code>Chewie</code> flutter package as my video player.</p>
  
  <p>I tried using <code>_controller.value.size.aspectRatio</code> but it returns an error 
  <code>The getter 'aspectRatio' was called on null.</code></p>
  
  <p>here is my code to get a video from gallery:</p>
  
  <pre><code>Future uploadVideoFromGallery() async {
      print("CALLED");
      Map&lt;PermissionGroup, PermissionStatus&gt; permissions =
          await PermissionHandler().requestPermissions(
              [PermissionGroup.storage, PermissionGroup.camera]);
  
      if (permissions[PermissionGroup.storage] == PermissionStatus.granted) {
        var videoFile = await ImagePicker.pickVideo(source: ImageSource.gallery);
        if (videoFile != null) {
          getVideoThumbnail(videoFile.path);
          setState(() {
            isFileImage = false;
            image = videoFile;
            _controller = VideoPlayerController.file(image);
          });
  
          print(videoFile.path);
        }
      } else {
        debugPrint('permission not granted');
      }
    }
  </code></pre>
  
  <p>and here is my code to place the <code>videoFile</code> :</p>
  
  <pre><code>Chewie(
                          controller: ChewieController(
                            videoPlayerController: _controller,
                            aspectRatio: _controller.value.size.aspectRatio,
                            materialProgressColors: ChewieProgressColors(
                              playedColor: Color(colorSecondary),
                              handleColor: Color(colorPrimary),
                              bufferedColor: Color(colorPrimary),
                            ),
                            placeholder: Container(
                              color: Colors.grey,
                            ),
                            autoInitialize: true,
                            looping: false,
                            errorBuilder: (context, errorMessage) {
                              return Center(
                                child: Text(
                                  errorMessage,
                                  style: TextStyle(color: Color(colorText)),
                                ),
                              );
                            },
                          ),
                        )
  </code></pre>