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 ----------- ::::::");

View File

@ -136,7 +136,9 @@ class DestinationMapPage extends StatelessWidget {
LatLngBounds bounds = c.bounds!;
indexController.currentBound.clear();
indexController.currentBound.add(bounds);
indexController.loadLocationsBound();
if(indexController.currentUser.length <= 0){
indexController.loadLocationsBound();
}
}
});
});

View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
class ProgressPage extends StatelessWidget {
const ProgressPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: Colors.transparent,
child: Center(
child: CircularProgressIndicator(),
),
);
}
}