From 1cc0689126117371028edcec30c99a2d7e45cd95 Mon Sep 17 00:00:00 2001 From: suresh Date: Tue, 12 Sep 2023 13:32:52 +0530 Subject: [PATCH] Added Profile picture --- lib/settings.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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();