second commit
This commit is contained in:
33
lib/Data/Provider/Tenantpricing/Tenantchargesprovider.dart
Normal file
33
lib/Data/Provider/Tenantpricing/Tenantchargesprovider.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart';
|
||||
import '../../../Model/Response/Tenantpricing/Tenantpricingresponse.dart';
|
||||
|
||||
|
||||
class TenantPricingProvider {
|
||||
Future<GetTenantPricing?> getTenantPricing(String urldata) async {
|
||||
GetTenantPricing? getTenantPricing;
|
||||
try {
|
||||
|
||||
final url = Uri.parse('$urldata',);
|
||||
|
||||
final response = await get(url,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
// 'Authorization': '$token',
|
||||
},
|
||||
);
|
||||
print('getTenantPricingresponse!!!!!!!!${response.body}');
|
||||
print('getTenantPricingproviderurldata!!!!!!!!${urldata.toString()}');
|
||||
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
|
||||
|
||||
getTenantPricing = GetTenantPricing.fromJson(parsedJson);
|
||||
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
print("error");
|
||||
}
|
||||
return getTenantPricing;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user