ApiRequest class
This class is used to make API requests.
The *Key fields control the multipart form field name for each upload
type. Defaults match the picker family — override only when your endpoint
expects a different field name.
Constructors
-
ApiRequest({required String url, String method = "post", String imageKey = "image", String videoKey = "video", String audioKey = "audio", String fileKey = "file", String postDataKey = "data", Duration? connectTimeout, Duration? sendTimeout, Duration? receiveTimeout, Map<
String, dynamic> ? headers, dynamic postData, dynamic onError(dynamic error)?})
Properties
- audioKey → String
-
final
- connectTimeout → Duration?
-
final
- fileKey → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, dynamic> ? -
final
- imageKey → String
-
final
- method → String
-
final
- onError → dynamic Function(dynamic error)?
-
final
- postData → dynamic
-
final
- postDataKey → String
-
final
- receiveTimeout → Duration?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTimeout → Duration?
-
final
- url → String
-
final
- videoKey → String
-
final
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