FormDataHelper class

Helper class for creating FormData

Constructors

FormDataHelper()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createFormData({Map<String, dynamic>? fields, Map<String, File>? files, Map<String, List<File>>? multipleFiles}) Future<FormData>
Create FormData from Map with optional files
createFormDataWithImages({Map<String, dynamic>? fields, required String imageFieldName, required List<File> images}) Future<FormData>
Create FormData with image files
createFormDataWithMixedFiles({Map<String, dynamic>? fields, List<FileUploadItem>? files}) Future<FormData>
Create FormData with mixed files (images, videos, documents)
createFormDataWithVideos({Map<String, dynamic>? fields, required String videoFieldName, required List<File> videos}) Future<FormData>
Create FormData with video files
createFromFilePath({Map<String, dynamic>? fields, required String fieldName, required String filePath, String? filename}) Future<FormData>
Create FormData from file path
getFileSize(File file) String
Get file size in human-readable format
validateFile({required File file, int? maxSizeInBytes, List<String>? allowedExtensions}) bool
Validate file before upload