Giter Club home page Giter Club logo

raftel-software / form_builder_file_picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flutter-form-builder-ecosystem/form_builder_file_picker

0.0 0.0 0.0 439 KB

File picker field widget for FlutterFormBuilder.

Home Page: https://pub.dev/packages/form_builder_file_picker

License: BSD 3-Clause "New" or "Revised" License

Ruby 4.66% C++ 32.57% C 2.22% Objective-C 0.06% Kotlin 0.22% Dart 25.84% Swift 1.81% HTML 6.13% CMake 26.49%

form_builder_file_picker's Introduction

Form Builder File Picker

File Picker Field for flutter_form_builder package

Pub Version GitHub Workflow Status CodeFactor Grade Codecov


Features

  • Automatic handle permissions
  • Show images preview

Use

Setup

Since this package makes use of file_picker package, for platform specific setup follow this instructions

Basic use

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

  FormBuilderFilePicker(
    name: "images",
    decoration: InputDecoration(labelText: "Attachments"),
    maxFiles: null,
    previewImages: true,
    onChanged: (val) => print(val),
    typeSelectors: [
      TypeSelector(
        type: FileType.any,
        selector: Row(
          children: <Widget>[
            Icon(Icons.add_circle),
            Padding(
              padding: const EdgeInsets.only(left: 8.0),
              child: Text("Add documents"),
            ),
          ],
        ),
      ),
    ],
    onFileLoading: (val) {
      print(val);
    },
  ),

Specific uses

On mobile platforms the file picker will open a default document picker if used with FileType.any. If you want to be able to pick documents and images in the same form field, you will need to define different file types and different selectors. To achieve this use the typeSelectors parameter. This way the user will see two buttons to open a file picker for documents and a file picker for the photos gallery.

For example:

FormBuilderFilePicker(
  name: "attachments",
  previewImages: false,
  allowMultiple: true,
  withData: true,
  typeSelectors: [
    TypeSelector(
      type: FileType.any,
      selector: Row(
        children: <Widget>[
          Icon(Icons.add_circle),
          Padding(
            padding: const EdgeInsets.only(left: 8.0),
            child: Text("Add documents"),
          ),
        ],
      ),
    ),
    if (!kIsWeb)
      TypeSelector(
        type: FileType.image,
        selector: Row(
          children: <Widget>[
            Icon(Icons.add_photo_alternate),
            Padding(
              padding: const EdgeInsets.only(left: 8.0),
              child: Text("Add images"),
            ),
          ],
        ),
      ),
    ],
  )

Support

Contribute

You have some ways to contribute to this packages

  • Beginner: Reporting bugs or request new features
  • Intermediate: Implement new features (from issues or not) and created pull requests
  • Advanced: Join the organization like a member and help coding, manage issues, dicuss new features and other things

See contribution guide for more details

Questions and answers

You can question or search answers on Github discussion or on StackOverflow

Donations

Donate or become a sponsor of Flutter Form Builder Ecosystem

Become a Sponsor

Roadmap

Ecosystem

Take a look to our awesome ecosystem and all packages in there

Thanks to

All constributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.