profile upload functionality

dev
Sneha 1 year ago
parent 1559952dab
commit 53055b6e55

@ -41,7 +41,7 @@ class _DashboardState extends State<Dashboard> {
Future<void> uploadProfileApi(image) async { Future<void> uploadProfileApi(image) async {
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["picture"] = image.toString(); payload["imagePath"] = image.toString();
var response1= await AppSettings.updateProfilePicture(payload); var response1= await AppSettings.updateProfilePicture(payload);
print(response1); print(response1);

@ -72,6 +72,7 @@ class AppSettings {
static String latitude=''; static String latitude='';
static String longitude=''; static String longitude='';
static String supplierAddress = ''; static String supplierAddress = '';
static String profilepic = '';
static bool servicestatus = false; static bool servicestatus = false;
static bool haspermission = false; static bool haspermission = false;
static late LocationPermission permission; static late LocationPermission permission;
@ -103,7 +104,7 @@ class AppSettings {
static String acceptBookingRequestsUrl = host + 'ordernow'; static String acceptBookingRequestsUrl = host + 'ordernow';
static String acceptRequestUrl = host +"friend-request/accept"; static String acceptRequestUrl = host +"friend-request/accept";
static String rejectRequestUrl = host +"friend-request/reject"; 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('email', input['simplydata']['email'][0]['email'], 'STRING');
await saveData('supplierId', input['simplydata']['supplierId'], 'STRING'); await saveData('supplierId', input['simplydata']['supplierId'], 'STRING');
await saveData('supplieraddress', input['simplydata']['office_address'], 'STRING'); await saveData('supplieraddress', input['simplydata']['office_address'], 'STRING');
await saveData('profile', input['simplydata']['picture'], 'STRING');
await loadDataFromMemory(); await loadDataFromMemory();
} }
@ -889,6 +891,7 @@ class AppSettings {
phoneNumber=await getData('phone', 'STRING'); phoneNumber=await getData('phone', 'STRING');
supplierId=await getData('supplierId', 'STRING'); supplierId=await getData('supplierId', 'STRING');
supplierAddress=await getData('supplieraddress', 'STRING'); supplierAddress=await getData('supplieraddress', 'STRING');
profilepic=await getData('profile', 'STRING');
} }
//assign saved values to variables //assign saved values to variables

Loading…
Cancel
Save