uploadFile method
Upload a file to the backend for the given step.
Implementation
Future<Map<String, dynamic>> uploadFile({
required String stepName,
required String fieldName,
required List<int> fileBytes,
required String fileName,
}) async {
_loading = true;
notifyListeners();
try {
final response = await _apiService.uploadFile(
stepName: stepName,
fieldName: fieldName,
fileBytes: fileBytes,
fileName: fileName,
);
_loading = false;
notifyListeners();
return response;
} catch (e) {
_loading = false;
notifyListeners();
rethrow;
}
}