Files
daily_mobileapp_merchant/lib/Data/Provider/Getcustomeraddress/Getcustomeraddressprovider.dart
2026-05-27 10:35:09 +05:30

32 lines
918 B
Dart

import 'dart:convert';
import 'package:http/http.dart';
import '../../../Model/Response/Getcustomeraddress/GetCustomerAddress.dart';
class GetCustomersAddressProvider{
Future<GetCustomerAddress?> getCustomerAddress(String urldata,) async {
GetCustomerAddress? getCustomerAddress;
try {
final url = Uri.parse('$urldata');
final response = await get(url, headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
// 'Authorization': '$token',
});
print('getCustomerAddress!!!!!!!!${response.body}');
print('getCustomerAddressproviderurldata!!!!!!!!${urldata.toString()}');
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
getCustomerAddress = GetCustomerAddress.fromJson(parsedJson);
} catch (e) {
print(e.toString());
print("error");
}
return getCustomerAddress;
}
}