Files
daily_mobileapp_merchant/lib/Data/Provider/Location/Updatelocation/Updatelocationprovider.dart
2026-05-27 10:35:09 +05:30

48 lines
1.5 KiB
Dart

import 'dart:convert';
import 'package:http/http.dart';
import '../../../../Model/Request/Location/Updatelocation/Updatelocationrequest.dart';
import '../../../../Model/Response/Location/Updatelocation/Updatelocationresponse.dart';
class UpdateLocationProvider{
Future<UpdateLocationResponse?> updateLocation(UpdateLocation data,String urldata,) async {
UpdateLocationResponse? updateLocationResponse;
try {
final url = Uri.parse(urldata);
final response = await put(url,
body: json.encode(data),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
// 'Authorization': '$token',
});
print('updateLocationResponseresponsebody ${response.body}');
print('updateLocationResponsedatatoJson ${data.toJson()}');
print('updateLocationResponseresponseorderdate ${data.tenantid}');
print('updateLocationResponseresponsetenantid ${data.locationid}');
print('updateLocationResponseresponsemoduleid ${data.moduleid}');
print('updateLocationResponseresponsepartnerid ${data.partnerid}');
// print('headerssssssssss ${response.headers}');
print('CreateOrderurlsssssssssss ${urldata.toString()}');
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
updateLocationResponse = UpdateLocationResponse.fromJson(parsedJson);
print('createOrderinprovider $updateLocationResponse');
} catch (e) {
print(e.toString());
print("error");
}
return updateLocationResponse;
}
}