diff --git a/lib/settings.dart b/lib/settings.dart index 9d000a8..1f244b0 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -124,6 +124,8 @@ class AppSettings { static String acceptRequestUrl = host +"friend-request/accept"; static String rejectRequestUrl = host +"friend-request/reject"; static String profilePicUrl = host + 'supplier/profile-picture'; + static String uploadPicUrl = host + 'uploads'; + @@ -135,6 +137,8 @@ class AppSettings { static File? updatedImage; + static String profilePictureUrl = ''; + static String image=''; static var api = { 'signIn': host + '/login', @@ -158,7 +162,15 @@ class AppSettings { } + static Future uploadImageHTTPNew(file) async { + var request = http.MultipartRequest('POST', Uri.parse(uploadPicUrl + '/' + supplierId)); + request.files.add(await http.MultipartFile.fromPath('picture', file.path)); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + + } ////request headers with content type static Future> buildRequestHeaders() async { Map _headers = new Map();