From 53055b6e55fb5a3285ed0d69248314d78cfcd5b6 Mon Sep 17 00:00:00 2001 From: Sneha Date: Mon, 10 Jul 2023 15:36:39 +0530 Subject: [PATCH] profile upload functionality --- lib/dashboard.dart | 2 +- lib/settings.dart | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/dashboard.dart b/lib/dashboard.dart index bd94d40..6750950 100644 --- a/lib/dashboard.dart +++ b/lib/dashboard.dart @@ -41,7 +41,7 @@ class _DashboardState extends State { Future uploadProfileApi(image) async { var payload = new Map(); - payload["picture"] = image.toString(); + payload["imagePath"] = image.toString(); var response1= await AppSettings.updateProfilePicture(payload); print(response1); diff --git a/lib/settings.dart b/lib/settings.dart index 382a1c9..a257231 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -72,6 +72,7 @@ class AppSettings { static String latitude=''; static String longitude=''; static String supplierAddress = ''; + static String profilepic = ''; static bool servicestatus = false; static bool haspermission = false; static late LocationPermission permission; @@ -103,7 +104,7 @@ class AppSettings { static String acceptBookingRequestsUrl = host + 'ordernow'; static String acceptRequestUrl = host +"friend-request/accept"; static String rejectRequestUrl = host +"friend-request/reject"; - static String profilePicUrl = host + 'supplier/profile-picture'; + static String profilePicUrl = host + 'upload-image'; @@ -873,6 +874,7 @@ class AppSettings { await saveData('email', input['simplydata']['email'][0]['email'], 'STRING'); await saveData('supplierId', input['simplydata']['supplierId'], 'STRING'); await saveData('supplieraddress', input['simplydata']['office_address'], 'STRING'); + await saveData('profile', input['simplydata']['picture'], 'STRING'); await loadDataFromMemory(); } @@ -889,6 +891,7 @@ class AppSettings { phoneNumber=await getData('phone', 'STRING'); supplierId=await getData('supplierId', 'STRING'); supplierAddress=await getData('supplieraddress', 'STRING'); + profilepic=await getData('profile', 'STRING'); } //assign saved values to variables