uploadImage function

Future uploadImage(
  1. BuildContext context, {
  2. FormData? formData,
  3. Function? onProgress,
})

upload image with form data

Implementation

Future uploadImage(BuildContext context,
    {FormData? formData, Function? onProgress}) async {
  Htify clo = Htify.clourage();
  return await clo
      .sendFile(context, '${routes['uploadImage']}', formData ?? FormData(),
          onProgress: (int sent, int total) {
    if (onProgress is Function) {
      onProgress(sent, total);
    }
  });
}