update to add resume app from sleep

This commit is contained in:
Mohamed Nouffer
2023-08-16 14:53:32 +05:30
parent 68bf3e9ab3
commit 2ab96cc3d0
51 changed files with 748 additions and 789 deletions

View File

@ -37,17 +37,17 @@ class LocationService{
static Future<GeoJsonFeatureCollection?> loadLocationsFor(String perfecture, String cat) async {
final IndexController indexController = Get.find<IndexController>();
String url = "";
String server_url = ConstValues.currentServer();
String serverUrl = ConstValues.currentServer();
if(cat.isNotEmpty){
if(indexController.currentUser.isNotEmpty){
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/inperf/?rog=${r}&perf=' + perfecture + '&cat=' + cat;
url = '$serverUrl/api/inperf/?rog=$r&perf=' + perfecture + '&cat=' + cat;
}
else {
url = '${server_url}/api/inperf/?perf=' + perfecture + '&cat=' + cat;
url = '$serverUrl/api/inperf/?perf=' + perfecture + '&cat=' + cat;
}
}
else{
@ -55,13 +55,13 @@ class LocationService{
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/inperf/?rog=${r}&perf=' + perfecture;
url = '$serverUrl/api/inperf/?rog=$r&perf=' + perfecture;
}
else {
url = '${server_url}/api/inperf/?perf=' + perfecture;
url = '$serverUrl/api/inperf/?perf=' + perfecture;
}
}
print('++++++++${url}');
print('++++++++$url');
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
@ -78,13 +78,13 @@ class LocationService{
static Future<List<dynamic>?> getLocationsExt(String token) async {
List<dynamic> ext = [];
String server_url = ConstValues.currentServer();
String url = '${server_url}/api/locsext/';
print('++++++++${url}');
String serverUrl = ConstValues.currentServer();
String url = '$serverUrl/api/locsext/';
print('++++++++$url');
final response = await http.post(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Token ${token}'
'Authorization': 'Token $token'
},
body: jsonEncode(<String, String>{
'token': token,
@ -102,16 +102,16 @@ class LocationService{
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(String subperfecture, String cat) async {
final IndexController indexController = Get.find<IndexController>();
String url = "";
String server_url = ConstValues.currentServer();
String serverUrl = ConstValues.currentServer();
if(cat.isNotEmpty){
if(indexController.currentUser.isNotEmpty){
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/insubperf?rog=${r}&subperf=' + subperfecture + '&cat=' + cat;
url = '$serverUrl/api/insubperf?rog=$r&subperf=' + subperfecture + '&cat=' + cat;
}
else{
url = '${server_url}/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
url = '$serverUrl/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
}
}
else{
@ -119,13 +119,13 @@ class LocationService{
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/insubperf?rog=${r}&subperf=' + subperfecture;
url = '$serverUrl/api/insubperf?rog=$r&subperf=' + subperfecture;
}
else{
url = '${server_url}/api/insubperf?subperf=' + subperfecture;
url = '$serverUrl/api/insubperf?subperf=' + subperfecture;
}
}
print('++++++++${url}');
print('++++++++$url');
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
@ -145,16 +145,16 @@ class LocationService{
print("-------- in location for bound -------------");
final IndexController indexController = Get.find<IndexController>();
String url = "";
String server_url = ConstValues.currentServer();
String serverUrl = ConstValues.currentServer();
if(cat.isNotEmpty){
if(indexController.currentUser.isNotEmpty){
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/inbound?rog=${r}&grp=$grp&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat;
url = '$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4' '&cat=' + cat;
}
else{
url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat;
url = '$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4' '&cat=' + cat;
}
}
else{
@ -162,14 +162,14 @@ class LocationService{
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
print("-------- requested user group ${grp} -------------");
url = '${server_url}/api/inbound?rog=${r}&grp=$grp&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}';
print("-------- requested user group $grp -------------");
url = '$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
}
else{
url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}';
url = '$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
}
}
print('++++++++${url}');
print('++++++++$url');
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
@ -200,17 +200,17 @@ class LocationService{
if(cat == "-all-"){
cat = "";
}
String server_url = ConstValues.currentServer();
print("loadCustomLocations url is ----- ${cat}");
String serverUrl = ConstValues.currentServer();
print("loadCustomLocations url is ----- $cat");
if(cat.isNotEmpty){
if(indexController.currentUser.isNotEmpty){
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/custom_area/?rog=${r}&&cat=' + cat;
url = '$serverUrl/api/custom_area/?rog=$r&&cat=' + cat;
}
else{
url = '${server_url}/api/custom_area/?&cat=' + cat;
url = '$serverUrl/api/custom_area/?&cat=' + cat;
}
}
else{
@ -218,13 +218,13 @@ class LocationService{
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
String r = _rog == true ? 'True': 'False';
var grp = indexController.currentUser[0]['user']['event_code'];
url = '${server_url}/api/customarea?rog=${r}&name=${name}';
url = '$serverUrl/api/customarea?rog=$r&name=$name';
}
else{
url = '${server_url}/api/customarea?name=${name}';
url = '$serverUrl/api/customarea?name=$name';
}
}
print('++++++++${url}');
print('++++++++$url');
final response = await http.get(Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',