title: Flutter - Upload csv file
body: <p>I would like to upload csv file in Flutter. I am using <code>FileUploadInputElement</code> for file browsing. The problem I issue is how to convert the data to csv format.</p>
  <p>This is currently the code I am using:</p>
  <pre><code>class _GenesTableTabState extends State&lt;GenesTableTab&gt; {
    Uint8List uploadedCsv;
    String option1Text;
  
    _startFilePicker() async {
      InputElement uploadInput = FileUploadInputElement();
      uploadInput.click();
  
      uploadInput.onChange.listen((e) {
        // read file content as dataURL
        final files = uploadInput.files;
        if (files.length == 1) {
          final file = files[0];
          FileReader reader = FileReader();
  
          reader.onLoadEnd.listen((e) {
            setState(() {
              uploadedCsv = Base64Decoder()
                  .convert(reader.result.toString().split(&quot;,&quot;).last);
            });
          });
  
          reader.onError.listen((fileEvent) {
            setState(() {
              option1Text = &quot;Some Error occured while reading the file&quot;;
            });
          });
  
          reader.readAsDataUrl(file);
        }
      });
    }
  </code></pre>
  <p>I don't know how to handle <code>uploadedCsv</code> field after the decoding.</p>