form_builder_asset_picker 1.1.1 icon indicating copy to clipboard operation
form_builder_asset_picker: ^1.1.1 copied to clipboard

File picker Field for flutter_form_builder package. Used to select files as part of form input.

form_builder_asset_picker #

Asset picker Field for flutter_form_builder package. Used to select files as part of form input. It's for the web and mobile apps. Desktop wasn't tested.

This is a fork of form_builder_file_picker made by Danvick Miller.

Setup #

This package makes use of file_picker package and permission_handler package. For platform specific setup, follow their instructions.

Usage #

 import 'package:flutter_form_builder/flutter_form_builder.dart';
 import 'package:form_builder_file_picker/form_builder_asset_picker.dart';

 ...

 final List<String>? _allowedExtensions = ['png', 'pdf'];

 ...

 FormBuilderAssetPicker(
    name: 'pick-file',
    allowedExtensions: _allowedExtensions,
    allowMultiple: true,
    maxFiles: 5,
    type: FileType.custom,
    decoration: const InputDecoration(border: InputBorder.none),
    selector: Row(
        children: const [
            Icon(Icons.file_upload),
            Text('Upload')
        ]
    )
 )

Additional Notes #

After version 7.0.0 of "flutter_form_builder", you will need to install the package "form_builder_validators" if you wish to use their form validators.

4
likes
120
pub points
80%
popularity

Publisher

unverified uploader

File picker Field for flutter_form_builder package. Used to select files as part of form input.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

file_picker, flutter, flutter_form_builder, form_builder_validators

More

Packages that depend on form_builder_asset_picker