File Upload

Loading preview

Starting the Flutter app

A Flutter file upload dropzone with a dashed CustomPaint border, drag-over state, per-file progress, size checks and retry.

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

The dropzone is a DragTarget for sample chips, which demonstrates the hover and drop states without a platform plugin. Both paths end in _add, which applies the size limit and duplicate check before starting _run. That method is a timer standing in for an upload stream, and data.csv fails once at 60 percent to show the retry path. _DashedBorderPainter extracts dashes from the rounded outline using path metrics. For production, call _add from your file picker or a desktop drop plugin, write real progress to _Upload, and cancel the request in _remove. Attach stays disabled until every file finishes.