flutter_file_uploader 0.1.0 copy "flutter_file_uploader: ^0.1.0" to clipboard
flutter_file_uploader: ^0.1.0 copied to clipboard

Flutter widgets that simplify the creation and use of the en_file_uploader library. They include both the UI and business logic for file management.

Flutter File Uploader #

Features #

This package use en_file_uploader and provides widgets for displaying and managing file uploads.

FileUploader is a widget that encapsulates the logic for adding and removing files to be uploaded. Each file can have its own IFileUploadHandler for customized uploads.

FileCard is a file upload widget agnostic of en_file_uploader, while FileUploadControllerProvider is a provider that encapsulates the business logic for uploading a file. ProvidedFileCard combines FileCard with FileUploadControllerProvider.

Usage #

FileUploader(
    builder: (context, ref) {
        // for each file a ref is created using the provided `IFileUploadHandler`.
        // Here, a widget for managing file uploads should be inserted.
        // ProvidedFileCard automatically provides complete file management and allows for graphical customization.
        // To manage the upload while creating your own widget, use only FileUploadControllerProvider. For just the UI, use FileCard.
        return ProvidedFileCard(
            ref: ref,
            content: Text("filename"),
        );
    },
    onPressedAddFiles: () async {
        // on tap add a list of files
    },
    onFileAdded: (file) async {
        // for each file added create a custom `IFileUploadHandler`
    },
    onFileUploaded: (file) {
        print("file uploaded ${file.id}");
    },
    onFileRemoved: (file) {
        print("file removed ${file.id}");
    },
    placeholder: Text("add a file"),
),

Widgets #

FileUploader #

FileUploader is a widget that encapsulates the logic for adding and removing files to be uploaded. Each file can have its own IFileUploadHandler for customized uploads.

Providers #

Widgets that use the provider library to insert and consume FileUploadControllerModel.

  • FileUploadControllerProvider: ChangeNotifierProvider with FileUploadControllerModel
  • FileUploadControllerSelector: Selector with FileUploadControllerModel
  • FileUploadControllerConsumer: Consumer with FileUploadControllerModel

FileCard #

A card that displays the progress of a file upload.

ProvidedFileCard #

FileCard + FileUploadControllerProvider + FileUploadControllerConsumer

Screenshot #

image video

6
likes
150
pub points
56%
popularity

Publisher

verified publishermattiapispisa.it

Flutter widgets that simplify the creation and use of the en_file_uploader library. They include both the UI and business logic for file management.

Homepage
Repository (GitHub)
View/report issues

Topics

#file #upload #widget #en-file-uploader

Documentation

API reference

License

MIT (license)

Dependencies

en_file_uploader, flutter, mobkit_dashed_border, provider

More

Packages that depend on flutter_file_uploader