import 'dart:convert'; import 'package:http/http.dart' as http; import '../../../../Model/Response/Tenantlocation/Getlocationbyidresponse.dart'; class GetLocationsProvider{ Future getLocationById(String urldata) async { GetLocationByTenantId? getLocationById; try { final url = Uri.parse('$urldata',); final response = await http.get(url, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', // 'Authorization': '$token', }, ); print('GetLocation!!!!!!!!${response.body}'); print('GetLocationproviderurldata!!!!!!!!${urldata.toString()}'); Map parsedJson = json.decode(response.body.toString()); getLocationById = GetLocationByTenantId.fromJson(parsedJson); } catch (e) { print(e.toString()); print("error"); } return getLocationById; } }