uploadFile method

  1. @override
Future<FileUploadResponse> uploadFile(
  1. String filePath,
  2. String userId
)
override

Implementation

@override
Future<FileUploadResponse> uploadFile(String filePath, String userId) async {
  final formData = FormData.fromMap({
    'file': await MultipartFile.fromFile(filePath),
    'user': userId,
  });
  final response = await _dio.post('/files/upload', data: formData);
  return FileUploadResponse.fromJson(response.data);
}