Search code examples
dartdart-io

Using 'dart:io' in dartium ? Any work arounds?


I am new to dart and I am trying to read data from a file and use the contents to draw something canvas. In doing so I am running into 'The built-in library 'dart:io' is not available on Dartium ' issue.

I understand Dart has limitations as Javascript in that code that is running in a browser cannot natively access the File System of the running client.

At the same time are there any tips on how to read a file and also use the contents to write it to canvas?

Thanks in advance.


Solution

  • I fixed my problem by prompting the user to choose the file. Similar approach as in https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications but using DART.