This commit is contained in:
Mohamed Nouffer
2022-05-12 02:17:08 +05:30
parent 9d253fc5e2
commit 80a976baa0
37 changed files with 1159 additions and 592 deletions

View File

@ -6,7 +6,7 @@ import 'package:http/http.dart' as http;
class LocationService{
static Future<GeoJsonFeatureCollection?> loadLocations() async {
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',
@ -20,8 +20,15 @@ class LocationService{
return null;
}
static Future<GeoJsonFeatureCollection?> loadLocationsFor(String perfecture) async {
String url = 'http://container.intranet.sumasen.net:8100/api/inperf/?perf=' + perfecture;
static Future<GeoJsonFeatureCollection?> loadLocationsFor(String perfecture, String cat) async {
String url = "";
if(cat.isNotEmpty){
url = 'http://localhost:8100/api/inperf/?perf=' + perfecture + '&cat=' + cat;
}
else{
url = 'http://localhost:8100/api/inperf/?perf=' + perfecture;
}
//String url = 'http://localhost:8100/api/inperf/?perf=' + perfecture + '&cat=' + cat;
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
@ -37,8 +44,14 @@ class LocationService{
}
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(String subperfecture) async {
String url = 'http://container.intranet.sumasen.net:8100/api/insubperf?subperf=' + subperfecture;
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(String subperfecture, String cat) async {
String url = "";
if(cat.isNotEmpty){
url = 'http://localhost:8100/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
}
else{
url = 'http://localhost:8100/api/insubperf?subperf=' + subperfecture;
}
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',