File Picker unable to import

Resolved

I'm trying to use this code:

FilePickerResult? result = await FilePicker.platform.pickFiles(
    type: FileType.custom,
    allowedExtensions: ['csv'],
  );

FlutterFlow states that the file_picker package, version 5.2.0, is already installed. It looks like it still needs to be imported though because I get errors using the above code. So then I import it using the code from pub.dev:

import 'package:file_picker/file_picker.dart';

But then I get an error on that importing line of code:

Target of URI doesn't exist: 'package:file_picker/file_picker.dart'. Try creating the file referenced by the URI, or try using a URI for a file that does exist.

So how do I get things set up so that I can use FilePicker?

1
7 replies