29 lines
790 B
Dart
29 lines
790 B
Dart
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;
|
|
}
|
|
|
|
} |