second commit
This commit is contained in:
29
lib/Data/Provider/Applocation/Applocationprovider.dart
Normal file
29
lib/Data/Provider/Applocation/Applocationprovider.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart';
|
||||
import '../../../Model/Response/Applocations/Applocationresponse.dart';
|
||||
|
||||
|
||||
class AppLocationProvider{
|
||||
|
||||
Future<GetAppLocations?> getAppLocations(String urldata,) async {
|
||||
GetAppLocations? getAppLocations;
|
||||
try {
|
||||
final url = Uri.parse(urldata);
|
||||
|
||||
final response = await get(url,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
});
|
||||
print('getAppLocationsproviderurldata!!!!!!!!${urldata.toString()}');
|
||||
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
|
||||
|
||||
getAppLocations = GetAppLocations.fromJson(parsedJson);
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
print("error");
|
||||
}
|
||||
return getAppLocations;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user