Examples
- Basic
- With Label & Description
- Custom Error Handling
Properties
Required
ValueChanged<Uint8List?>
required
Called when an image is selected, dropped, or cleared. Receives the raw image bytes, or
null when the image is removed.Content
Uint8List?
The currently displayed image as raw bytes. When provided, the image is rendered inside the picker with a swap overlay on hover and an optional clear button.
String?
A label displayed above the picker area.
String?
Helper text displayed below the picker area.
String?
External error text displayed below the picker. Overrides any internal error messages.
String?
default:"Select or drop an image"
Custom placeholder text shown when no image is selected.
String? Function(NeoImagePickerError)?
Custom error message resolver. Return a string to override the default message for a specific error, or
null to use the default.Layout
double?
Explicit width for the drop zone. When null, the drop zone expands to the available width.
double?
default:"240"
Explicit height for the drop zone. Defaults to 240 when unconstrained.
int
default:"104857600 (100MB)"
Maximum allowed file size in bytes. Files exceeding this limit trigger a
fileTooLarge error.bool
default:"true"
Whether to show a clear button in the top-right corner when an image is displayed.
State
bool
default:"true"
Controls whether the picker responds to taps and drag-and-drop. Disabled pickers show reduced opacity and a forbidden cursor.
Enums
NeoImagePickerError
Error types that can occur during image selection or processing.fileTooLarge: The selected file exceedsmaxFileSize.unsupportedFormat: The dropped file is not a supported image format.pickFailed: The file picker failed to open or return a result.readFailed: The file could not be read from disk.dropFailed: The drag-and-drop operation failed.renderFailed: The image bytes could not be rendered (invalid format).unknown: An unexpected error occurred.
Best Practices
- Lower
maxFileSizefor a small image, such as an avatar, or compress before upload. - Map
onErrorto the message you want to show.
Behavior
- Accepted types are PNG, JPEG, GIF, WebP, HEIC, HEIF, BMP, and TIFF.
- A loading overlay shows while a file is read.
- The selected image uses
BoxFit.contain. shows a swap icon. - A drag over the drop zone paints the border with
theme.colors.success.

