title: Loading a file from the assets folder in Flutter / Dart
body: <p>I'm using the <code>video_player</code> plugin for Flutter to play a .mp4 file. In the example code, there's a demo for using the <code>.network()</code> method to play a file, but in the source code, I'm seeing a <code>.file()</code> method for running local content.</p>
  
  <p>I've added my assets directory to the <code>pubspec.yaml</code> file, but on iOS, I'm not seeing an easy way to get the file:// path to my video and pass it into the video player.</p>
  
  <p>It looks like this is accomplished with an assetBundle constructor, but I'm not quite sure how to phrase the code. Intuitively, it feels like it should look something like this:</p>
  
  <pre><code>  void initState() async {
      super.initState();
      final video = File('assets/video.mp4'); 
  
      _controller = VideoPlayerController.file(video)
        ..initialize().then((_) {
          setState(() {});
        });
    }
  </code></pre>
  
  <p>Any ideas?</p>