file_picker_cross 3.0.1 copy "file_picker_cross: ^3.0.1" to clipboard
file_picker_cross: ^3.0.1 copied to clipboard

outdated

Select, open or choose documents, images videos or other files on Android, iOS, the desktop and the web.

file_picker_cross #

Select files on Android, iOS, the desktop and the web.

Getting Started #

file_picker_cross allows you to select files from your device and is compatible with Android, iOS, Desktops (using both go-flutter or FDE) and the web.

This package was realized using file_picker (Mobile platforms and go-flutter) and 'file_chooser' (Desktops). We only added compatibility to the web and mixed everything.

Note: we recently had API changes. Please update your code accordingly.

FilePickerCross FilePickerCross.pick(
    type: FileTypeCross.any,                        // Available: `any`, `audio`, `image`, `video`, `custom`. Note: not available using FDE
    fileExtension: ''                               // Only if FileTypeCross.custom . May be any file extension like `.dot`, `.ppt,.pptx,.odp`
    );

String toString()

Uint8List toUint8List()

String toBase64()

MultipartFile toMultipartFile({String filename})

int get length

String get path // BETA: not working properly using go-flutter

Example:

    FilePickerCross.pick().then((filePicker) => setState(() {
          _filePath = filePicker.path;
          _fileLength = filePicker.toUint8List().lengthInBytes;
          try {
            _fileString = filePicker.toString();
          } catch (e) {
            _fileString =
                'Not a text file. Showing base64.\n\n' + filePicker.toBase64();
          }
        }));

What do go-flutter and FDE mean? #

Flutter initially only supported Android and iOS. To add support for desktop platforms, some people started the go-flutter providing Flutter applications on Windows, Linux and macOS using the Go language.

Later, Flutter itself announced desktop support (FDE) but still, it's not stable yet.

We try to support both as much as possible.

Web #

Of cause, it requires Flutter to be set up for web development.

Set up Flutter for Web

All Desktop platforms #

Of cause, it requires Flutter to be set up for your platform.

Please note, Windows is not officially supported by Google. Linux and macOS support is in alpha state. Expect issues and sometimes incompatible versions requiring manual hand work.

flutter channel dev # or master
flutter upgrade
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop

More information

Set up go-flutter Set up FDE

Mobile platforms #

No setup required 🎉.

macOS (using FDE) #

You will need to add an entitlement for either read-only access:

	<key>com.apple.security.files.user-selected.read-only</key>
	<true/>

or read/write access:

	<key>com.apple.security.files.user-selected.read-write</key>
	<true/>

depending on your use case.

Linux (using FDE) #

This plugin requires the following libraries:

  • GTK 3
  • pkg-config

Installation example for Debian-based systems:

sudo apt-get install libgtk-3-dev pkg-config

Moreover, you will need to update main.cc to include the GTK initialization and runloop changes shown in the testbed example.

  1. Delete your existing linux directory (make sure you know any manual modification you did): rm -rf linux
  2. Copy the testbed/linux subdirectory of this projects's example/ into your project.
155
likes
0
pub points
83%
popularity

Publisher

verified publishertestapp.schule

Select, open or choose documents, images videos or other files on Android, iOS, the desktop and the web.

Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

file_chooser, file_picker, flutter, http, http_parser

More

Packages that depend on file_picker_cross