uploadPhoto method

Future uploadPhoto(
  1. File file
)

Implementation

Future<dynamic> uploadPhoto(File file) async {
  String fileName = file.path.split('/').last;

  FormData formData = FormData.fromMap({
    "file": await MultipartFile.fromFile(file.path, filename: fileName),
  });

  return client.client.post("/storage/upload", data: formData);
}