title: How can we get permission to access storage/emulated/0/Android/data folder for a flutter application?
body: <p>I'm coding a video player application using flutter. I'm recursively trying to go through every folder to fetch all the files-&gt; then create an exclusive list of video files -&gt; then build a listView of all video files.</p>
  <p>But the compiler is not able to iterate and go inside the 'storage/emulated/0/Android/data' folder and therefore it is throwing a 'Permission denied' error.</p>
  <p>How can I, either, skip such unaccessible folders/files and continue the iteration, or How to get permission to access such folders(storage/emulated/0/Android/data)?</p>
  <p>I was expecting to get the list of all the files on my phone.</p>
  <pre><code>import 'dart:io';
  import 'package:flutter/material.dart';
  import 'package:mark_player/custom%20widgets/app_bar.dart';
  
  
  class newHomeScreen extends StatefulWidget {
    const newHomeScreen({ Key? key }) : super(key: key);
  
    @override
    State&lt;newHomeScreen&gt; createState() =&gt; _newHomeScreenState();
  }
  
  class _newHomeScreenState extends State&lt;newHomeScreen&gt; {
  
    Directory dir = Directory('/storage/emulated/0');
  
  @override
    void initState() {
  
     List &lt;FileSystemEntity&gt; filesBaby = dir.listSync(recursive: true);
     filesKittan(filesBaby);
      super.initState();
    }
  
    filesKittan(List &lt;FileSystemEntity&gt; files){
      for (var i = 0; i &lt; files.length; i++) {
        if (files[i].absolute.toString()=='/storage/emulated/0/Android/data') {
          continue;
      }print(files[i].absolute);
    }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold();
    }
  }
  </code></pre>