SmartApiFile class

Describes a single file to attach to a multipart request.

Prefer the SmartApiFile.single and SmartApiFile.list factories over the default constructor when binding files to explicit form-field keys (e.g. license_front, license_back, selfie).

Constructors

SmartApiFile({required String key, required String path, String? fileName})
Creates a file binding directly. Most callers should use SmartApiFile.single or SmartApiFile.list instead.
const
SmartApiFile.single({required String key, required String path, String? fileName})
A single file under a custom form-field key, e.g. SmartApiFile.single(key: "image", path: path).
factory

Properties

fileName → String?
Optional override for the filename sent to the server. Defaults to the last path segment of path when omitted.
final
hashCode → int
The hash code for this object.
no setterinherited
key → String
The multipart form-field name this file is sent under.
final
path → String
Local filesystem path of the file to upload.
final
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

list({required String key, required List<String> paths}) → List<SmartApiFile>
Multiple files grouped under the same form-field key, e.g. SmartApiFile.list(key: "images", paths: [p1, p2, p3]).