Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

marchdev-tk/file_selector

file_selector

Build GitHub GitHub stars

THIS PLUGIN IS DISCONTINUED

Getting Started

In order to use this plugin, add dependency in the pubspec.yaml:

file_selector:
 git:
 url: https://github.com/marchdev-tk/file_selector

Add an import to dart file:

import 'package:file_selector/file_selector.dart';

Samples

Web sample:

Web Sample

Desktop sample:

Desktop Sample

Mobile sample:

Mobile Sample

To pick single file use:

final File file = await FileSelector().pickFile(
 type: FileType.img,
 confirmButtonText: 'Select',
);

where:

  • confirmButtonText (works only on Desktop) if set, changes default confirmation text on file picker popup;

  • type represents the group of required types of specific type, could be one of the following:

    • any or */*
    • img or image/*
      • png or image/png
      • jpg or image/jpeg
      • gif or image/gif
      • bmp or image/bmp
    • pdf or application/pdf

To pick multiple file use:

final List<File> files = await FileSelector().pickFiles(
 types: [FileType.png, FileType.bmp],
 confirmButtonText: 'Select',
);

The only difference of pickFiles method from pickFile is that multiple files could be selected same as multiple types.

Return type File contains folowing fields:

  • name of the file
  • path to the file, for Web it is empty
  • bytes array of bytes

Feature requests and Bug reports

Feel free to post a feature requests or report a bug here.

Releases

No releases published

Packages

No packages published

Contributors 3

AltStyle によって変換されたページ (->オリジナル) /