Solved: To read and Write File in Flutter Web


Asked by Yogesh on July 24, 2019 (source).

I am working on flutter-web, I would like to do file operations(read and write) in flutter-web. For Android and IOS, I was using path_provider dependency. But in flutter-web it is not supported.

Can anyone help me with this. An example would be more helpful.

Thank you


Question answered by adib (source).

in the dart docs it has been explained ... dart:io is not available to web build ... it means that you can not directly access to system files in flutter web . the build will fail .. you need to remove the code in order to run it

this is a security thing .. js doesn't allow it too .. imagine a website that can read all your system files if you visit it .. that's why things like path reading or file reading is not allowed .. it goes same for flutter

hope you have your answer