update forced checkin for start point and nearbt start points
This commit is contained in:
@ -667,6 +667,29 @@ class DestinationController extends GetxController {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
int getForcedChckinDistance(Destination dest) {
|
||||
int _retValue = 100;
|
||||
if (dest.cp == -1) {
|
||||
return 500;
|
||||
}
|
||||
Destination? ds;
|
||||
for (Destination d in destinations) {
|
||||
if (d.cp == -1) {
|
||||
ds = d;
|
||||
}
|
||||
}
|
||||
if (ds != null) {
|
||||
var distance = const Distance();
|
||||
double distanceToDest = distance.as(LengthUnit.Meter,
|
||||
LatLng(dest.lat!, dest.lon!), LatLng(ds.lat!, ds.lon!));
|
||||
if (distanceToDest <= 500) {
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
|
||||
return _retValue;
|
||||
}
|
||||
|
||||
readUserToken() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
indexController.userToken = prefs.getString("user_token");
|
||||
|
||||
Reference in New Issue
Block a user