added travel from current location

This commit is contained in:
Mohamed Nouffer
2023-02-16 19:36:39 +05:30
parent a708cf23ee
commit 27768e4cfd
8 changed files with 91 additions and 5 deletions

View File

@ -695,6 +695,43 @@ class DestinationController extends GetxController {
});
}
buildShowDialog(BuildContext context) {
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return Center(
child: CircularProgressIndicator(),
);
});
}
void destinationMatrixFromCurrentPoint(List<Destination> points){
buildShowDialog(Get.context!);
MatrixService.getDestinations(points).then((mat){
print(" matrix is ------- ${mat}");
matrix = mat;
try{
indexController.routePoints = [];
indexController.routePointLenght.value = 0;
DestinationService.getDestinationLine(points, matrix)?.then((value){
indexController.routePoints = value;
indexController.routePointLenght.value = indexController.routePoints.length;
Get.toNamed(AppPages.TRAVEL);
});
destinationCount.value = destinations.length;
}
catch(_){
skip_gps = false;
return;
}
finally{
Get.back();
}
});
}
void PopulateDestinations(){
print("--------- destination controller populsting destinations ----------- ::::::");