This commit is contained in:
Mohamed Nouffer
2022-03-24 14:20:04 +05:30
parent 92bb6b8dcd
commit ea874c094c
7 changed files with 326 additions and 142 deletions

View File

@ -9,7 +9,7 @@ class LocationService{
final geo = GeoJson();
GeoJsonFeatureCollection? fs;
print("#### feature collection ####");
String url = 'http://container.intranet.sumasen.net:8100/api/location/';
String url = 'http://localhost:8100/api/location/';
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',

View File

@ -0,0 +1,24 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
class PerfectureService{
static Future<List<dynamic>?> loadPerfectures() async {
List<dynamic> perfs = [];
String url = 'http://localhost:8100/api/perf/';
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
);
if (response.statusCode == 200) {
perfs = json.decode(response.body);
}
return perfs;
}
}