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) {
print("---- in startTimer ----");
chekcs = 0;
//skip_gps = true;
double checkin_radious = fs.properties!['checkin_radius'] ?? double.infinity;
if(checkin_radious >= distance){
chekcs = 1;
indexController.currentFeature.clear();
Destination d = festuretoDestination(fs);
for(Destination de in destinations){
@ -116,9 +115,6 @@ class DestinationController extends GetxController {
print("---- before calling startTimer ----");
startTimer(d, distance);
}
if(chekcs == 0){
skip_gps = false;
}
}
void startTimer(Destination d, double distance) async {
@ -164,7 +160,7 @@ class DestinationController extends GetxController {
else
{
print("----- in location popup checkin cp - ${d.cp}----");
chekcs = 1;
chekcs = 2;
//is_in_checkin.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew())
@ -191,7 +187,7 @@ class DestinationController extends GetxController {
else{
// ask for checkin
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;
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => CameraPage())
@ -202,7 +198,7 @@ class DestinationController extends GetxController {
});
}
else if(is_in_rog.value == true && d.cp != -1){
chekcs = 1;
chekcs = 4;
is_in_checkin.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew())
@ -224,7 +220,7 @@ class DestinationController extends GetxController {
if(is_at_goal.value == false && rogaining_counted.value){
//goal
print("---- in goal -----");
chekcs = 1;
chekcs = 5;
is_at_goal.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => CameraPage())
@ -237,7 +233,7 @@ class DestinationController extends GetxController {
else if(is_in_rog.value == false){
//start
print("---- in start -----");
chekcs = 1;
chekcs = 6;
is_at_start.value = true;
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew())
@ -253,7 +249,6 @@ class DestinationController extends GetxController {
if(chekcs == 0){
skip_gps = false;
}
skip_gps = false;
}
// void startTimer2(Destination d, double distance) {
@ -468,7 +463,7 @@ class DestinationController extends GetxController {
is_in_rog.value = true;
}
void makeCheckin(Destination destination, bool action) async {
void makeCheckin(Destination destination, bool action, {String imageurl = ""}) async {
// print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ressssss ${action}@@@@@@@@@@@");
DatabaseHelper db = DatabaseHelper.instance;
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());
String _team = indexController.currentUser[0]["user"]["team_name"];
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} ------");
});
}

View File

@ -37,7 +37,7 @@ class ExternalService {
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 = {};
String url = 'https://natnats.mobilous.com/checkin_from_rogapp';
//print('---- toekn is ${token} -----');
@ -49,7 +49,8 @@ class ExternalService {
body: jsonEncode(<String, String>{
'team_name': teamname,
'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
SingleChildScrollView detailsSheet(BuildContext context) {
return SingleChildScrollView(
@ -438,6 +439,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
);
}
Future<Widget> wantToGo(BuildContext context)async {
bool _selected = false;