download method

Future<void> download({
  1. required String filePath,
  2. required String savePath,
  3. required dynamic onSuccess(
    1. File
    ),
  4. required dynamic onError(
    1. Response
    ),
  5. dynamic onException(
    1. Exception
    )?,
})

Implementation

Future<void> download({
  required final String filePath,
  required final String savePath,
  required final Function(File) onSuccess,
  required final Function(Response) onError,
  final Function(Exception)? onException,
}) async {
  await httpClient.download(
    endpoint: "/Media/Download?filePath=$filePath",
    savePath: savePath,
    onSuccess: onSuccess,
    onError: onError,
    onException: (final dynamic e) {
      if (onException != null) onException(e);
    },
  );
}