title: Flutter access denied , when i try to write a file into a specific folder
body: <p>I am trying to write a text file to a specific location (the location is chosen by the user using file_picker and i want the file to be visible to the user)</p>
  <p>I added</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
  </code></pre>
  <p>into AndroidManifest.xml , and request access at runtime</p>
  <pre><code>import 'dart:io';
  
  import 'package:flutter/material.dart';
  import 'package:file_picker/file_picker.dart';
  import 'package:permission_handler/permission_handler.dart';
  
  void main() =&gt; runApp(MaterialApp(home: MyHomePage()));
  
  class MyHomePage extends StatelessWidget {
    @override
    Future&lt;void&gt; write() async {
      var status = await Permission.storage.request();
  
      if (status.isGranted) {
        String directory = await FilePicker.getDirectoryPath();
        var status = await Permission.storage.request();
        File file = File(directory + 'test.txt');
        file.createSync();
  
        file.writeAsStringSync(
            'Here is some text to test the ability to write to external folder');
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
          child: FlatButton(
            child: Text('Write to file'),
            onPressed: () {
              write();
            },
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>This error appears</p>
  <pre><code>D/EGL_emulation(31407): eglMakeCurrent: 0xe9467200: ver 3 0 (tinfo 0xe940f630)
  I/FilePickerDelegate(31407): [SingleFilePick] File URI:content://com.android.providers.downloads.documents/tree/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Ffoo/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Ffoo
  I/FilePickerDelegate(31407): Absolute file path:/
  D/eglCodecCommon(31407): setVertexArrayObject: set vao to 0 (0) 0 0
  D/EGL_emulation(31407): eglCreateContext: 0xdde235c0: maj 3 min 0 rcv 3
  D/EGL_emulation(31407): eglMakeCurrent: 0xdde235c0: ver 3 0 (tinfo 0xdde38a70)
  D/EGL_emulation(31407): eglMakeCurrent: 0xe9467200: ver 3 0 (tinfo 0xe940f630)
  E/flutter (31407): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot create file, path = '/test.txt' (OS Error: Read-only file system, errno = 30)
  E/flutter (31407): #0      _File.throwIfError (dart:io/file_impl.dart:645:7)
  E/flutter (31407): #1      _File.createSync (dart:io/file_impl.dart:283:5)
  E/flutter (31407): #2      MyHomePage.write (package:store_to_phone_files/main.dart:18:12)
  E/flutter (31407): &lt;asynchronous suspension&gt;
  E/flutter (31407): #3      MyHomePage.build.&lt;anonymous closure&gt; (package:store_to_phone_files/main.dart:32:13)
  E/flutter (31407): #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
  E/flutter (31407): #5      _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:862:36)
  E/flutter (31407): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
  E/flutter (31407): #7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
  E/flutter (31407): #8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
  E/flutter (31407): #9      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
  E/flutter (31407): #10     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
  E/flutter (31407): #11     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
  E/flutter (31407): #12     PointerRouter._dispatchEventToRoutes.&lt;anonymous closure&gt; (package:flutter/src/gestures/pointer_router.dart:122:9)
  E/flutter (31407): #13     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
  E/flutter (31407): #14     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
  E/flutter (31407): #15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
  E/flutter (31407): #16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
  E/flutter (31407): #17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
  E/flutter (31407): #18     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
  E/flutter (31407): #19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
  E/flutter (31407): #20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
  E/flutter (31407): #21     _rootRunUnary (dart:async/zone.dart:1196:13)
  E/flutter (31407): #22     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
  E/flutter (31407): #23     _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
  E/flutter (31407): #24     _invoke1 (dart:ui/hooks.dart:275:10)
  E/flutter (31407): #25     _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)
  E/flutter (31407): 
  D/EGL_emulation(31407): eglMakeCurrent: 0xdde235c0: ver 3 0 (tinfo 0xdde38a70)
  D/eglCodecCommon(31407): setVertexArrayObject: set vao to 0 (0) 0 0
  </code></pre>
  <p>NOTE: I know that i can write the file to the app directory using path_provider but i want the user to choose the file location and i want the file to be visible to the user.</p>