update for GPS fix

This commit is contained in:
Mohamed Nouffer
2022-11-02 22:47:49 +05:30
parent 4d40b400b1
commit 9987b243f7
3 changed files with 16 additions and 16 deletions

View File

@ -100,10 +100,9 @@ class DestinationController extends GetxController {
void startTimerLocation(GeoJsonFeature fs, double distance) { void startTimerLocation(GeoJsonFeature fs, double distance) {
print("---- in startTimer ----"); print("---- in startTimer ----");
chekcs = 0; //skip_gps = true;
double checkin_radious = fs.properties!['checkin_radius'] ?? double.infinity; double checkin_radious = fs.properties!['checkin_radius'] ?? double.infinity;
if(checkin_radious >= distance){ if(checkin_radious >= distance){
chekcs = 1;
indexController.currentFeature.clear(); indexController.currentFeature.clear();
Destination d = festuretoDestination(fs); Destination d = festuretoDestination(fs);
for(Destination de in destinations){ for(Destination de in destinations){
@ -116,9 +115,6 @@ class DestinationController extends GetxController {
print("---- before calling startTimer ----"); print("---- before calling startTimer ----");
startTimer(d, distance); startTimer(d, distance);
} }
if(chekcs == 0){
skip_gps = false;
}
} }
void startTimer(Destination d, double distance) async { void startTimer(Destination d, double distance) async {
@ -164,7 +160,7 @@ class DestinationController extends GetxController {
else else
{ {
print("----- in location popup checkin cp - ${d.cp}----"); print("----- in location popup checkin cp - ${d.cp}----");
chekcs = 1; chekcs = 2;
//is_in_checkin.value = true; //is_in_checkin.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true, showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew()) builder:((context) => BottomSheetNew())
@ -191,7 +187,7 @@ class DestinationController extends GetxController {
else{ else{
// ask for checkin // ask for checkin
if(d.hidden_location != null && d.hidden_location ==true && is_in_rog.value == true && d.cp != -1){ if(d.hidden_location != null && d.hidden_location ==true && is_in_rog.value == true && d.cp != -1){
chekcs = 1; chekcs = 3;
is_in_checkin.value = true; is_in_checkin.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true, showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => CameraPage()) builder:((context) => CameraPage())
@ -202,7 +198,7 @@ class DestinationController extends GetxController {
}); });
} }
else if(is_in_rog.value == true && d.cp != -1){ else if(is_in_rog.value == true && d.cp != -1){
chekcs = 1; chekcs = 4;
is_in_checkin.value = true; is_in_checkin.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true, showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew()) builder:((context) => BottomSheetNew())
@ -224,7 +220,7 @@ class DestinationController extends GetxController {
if(is_at_goal.value == false && rogaining_counted.value){ if(is_at_goal.value == false && rogaining_counted.value){
//goal //goal
print("---- in goal -----"); print("---- in goal -----");
chekcs = 1; chekcs = 5;
is_at_goal.value = true; is_at_goal.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true, showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => CameraPage()) builder:((context) => CameraPage())
@ -237,7 +233,7 @@ class DestinationController extends GetxController {
else if(is_in_rog.value == false){ else if(is_in_rog.value == false){
//start //start
print("---- in start -----"); print("---- in start -----");
chekcs = 1; chekcs = 6;
is_at_start.value = true; is_at_start.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true, showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew()) builder:((context) => BottomSheetNew())
@ -253,7 +249,6 @@ class DestinationController extends GetxController {
if(chekcs == 0){ if(chekcs == 0){
skip_gps = false; skip_gps = false;
} }
skip_gps = false;
} }
// void startTimer2(Destination d, double distance) { // void startTimer2(Destination d, double distance) {
@ -468,7 +463,7 @@ class DestinationController extends GetxController {
is_in_rog.value = true; is_in_rog.value = true;
} }
void makeCheckin(Destination destination, bool action) async { void makeCheckin(Destination destination, bool action, {String imageurl = ""}) async {
// print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ressssss ${action}@@@@@@@@@@@"); // print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ressssss ${action}@@@@@@@@@@@");
DatabaseHelper db = DatabaseHelper.instance; DatabaseHelper db = DatabaseHelper.instance;
List<Destination> ddd = await db.getDestinationByLatLon(destination.lat!, destination.lon!); List<Destination> ddd = await db.getDestinationByLatLon(destination.lat!, destination.lon!);
@ -485,7 +480,7 @@ class DestinationController extends GetxController {
int cp_num = int.parse(destination.cp!.toString()); int cp_num = int.parse(destination.cp!.toString());
String _team = indexController.currentUser[0]["user"]["team_name"]; String _team = indexController.currentUser[0]["user"]["team_name"];
String _event_code = indexController.currentUser[0]["user"]["event_code"]; String _event_code = indexController.currentUser[0]["user"]["event_code"];
ExternalService().makeCheckpoint(_team, cp_num, _event_code).then((value){ ExternalService().makeCheckpoint(_team, cp_num, _event_code, imageurl).then((value){
print("------Ext service check point ${value} ------"); print("------Ext service check point ${value} ------");
}); });
} }

View File

@ -37,7 +37,7 @@ class ExternalService {
return _res; return _res;
} }
Future<Map<String, dynamic>> makeCheckpoint(String teamname, int cp, String eventcode) async { Future<Map<String, dynamic>> makeCheckpoint(String teamname, int cp, String eventcode, String imageurl) async {
Map<String, dynamic> _res = {}; Map<String, dynamic> _res = {};
String url = 'https://natnats.mobilous.com/checkin_from_rogapp'; String url = 'https://natnats.mobilous.com/checkin_from_rogapp';
//print('---- toekn is ${token} -----'); //print('---- toekn is ${token} -----');
@ -49,7 +49,8 @@ class ExternalService {
body: jsonEncode(<String, String>{ body: jsonEncode(<String, String>{
'team_name': teamname, 'team_name': teamname,
'cp_number': cp.toString(), 'cp_number': cp.toString(),
'event_code': eventcode 'event_code': eventcode,
'image': imageurl
}), }),
); );

View File

@ -284,6 +284,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
); );
} }
// show add location details // show add location details
SingleChildScrollView detailsSheet(BuildContext context) { SingleChildScrollView detailsSheet(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -438,6 +439,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
); );
} }
Future<Widget> wantToGo(BuildContext context)async { Future<Widget> wantToGo(BuildContext context)async {
bool _selected = false; bool _selected = false;