added travel from current location
This commit is contained in:
@ -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 ----------- ::::::");
|
||||
|
||||
|
||||
@ -136,8 +136,10 @@ class DestinationMapPage extends StatelessWidget {
|
||||
LatLngBounds bounds = c.bounds!;
|
||||
indexController.currentBound.clear();
|
||||
indexController.currentBound.add(bounds);
|
||||
if(indexController.currentUser.length <= 0){
|
||||
indexController.loadLocationsBound();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} ,
|
||||
|
||||
18
lib/pages/progress/progress.dart
Normal file
18
lib/pages/progress/progress.dart
Normal 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(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ import 'package:rogapp/pages/loading/loading_page.dart';
|
||||
import 'package:rogapp/pages/login/login_page.dart';
|
||||
import 'package:rogapp/pages/mainperf/mainperf_page.dart';
|
||||
import 'package:rogapp/pages/permission/permission.dart';
|
||||
import 'package:rogapp/pages/progress/progress.dart';
|
||||
import 'package:rogapp/pages/register/register_page.dart';
|
||||
import 'package:rogapp/pages/search/search_binding.dart';
|
||||
import 'package:rogapp/pages/search/search_page.dart';
|
||||
@ -46,6 +47,7 @@ class AppPages {
|
||||
static const CATEGORY = Routes.CATEOGORY;
|
||||
static const CHANGE_PASSWORD = Routes.CHANGE_PASSWORD;
|
||||
static const CAMERA_PAGE = Routes.CAMERA_PAGE;
|
||||
static const PROGRESS = Routes.PROGRESS;
|
||||
|
||||
static final routes = [
|
||||
// GetPage(
|
||||
@ -135,6 +137,10 @@ class AppPages {
|
||||
GetPage(
|
||||
name: Routes.CAMERA_PAGE,
|
||||
page: () => CameraPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.PROGRESS,
|
||||
page: () => ProgressPage(),
|
||||
)
|
||||
];
|
||||
}
|
||||
@ -23,4 +23,5 @@ abstract class Routes {
|
||||
static const CATEOGORY = '/category';
|
||||
static const CHANGE_PASSWORD = '/change_password';
|
||||
static const CAMERA_PAGE = '/camera_page';
|
||||
static const PROGRESS = '/progress';
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ class ConstValues{
|
||||
static const dev_server = "http://localhost:8100";
|
||||
static const dev_ip_server = "http://192.168.8.100:8100";
|
||||
static const dev_home_ip_server = "http://172.20.10.9:8100";
|
||||
static const dev_home_ip_mserver = "http://192.168.1.10:8100";
|
||||
|
||||
static String currentServer(){
|
||||
return server_uri;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_map/plugin_api.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/get_state_manager.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
@ -423,6 +425,25 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
],
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed:() async {
|
||||
GeoJsonFeature<GeoJsonMultiPoint> mp = indexController.currentFeature[0] as GeoJsonFeature<GeoJsonMultiPoint>;
|
||||
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
|
||||
Destination ds = Destination(
|
||||
lat: position.latitude,
|
||||
lon: position.longitude
|
||||
);
|
||||
|
||||
Destination tp = Destination(
|
||||
lat: mp.geometry!.geoSerie!.geoPoints[0].latitude,
|
||||
lon: mp.geometry!.geoSerie!.geoPoints[0].longitude
|
||||
);
|
||||
|
||||
Get.back();
|
||||
|
||||
destinationController.destinationMatrixFromCurrentPoint([ds, tp]);
|
||||
},
|
||||
child:Text("ここへ行く")),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.0,),
|
||||
@ -522,7 +543,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
indexController.rog_mode == 0 ?
|
||||
IconButton(
|
||||
@ -640,9 +661,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
Container()
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ class MapWidget extends StatelessWidget {
|
||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
||||
// do something
|
||||
}
|
||||
if (mapEvent is MapEventMoveEnd) {
|
||||
if (mapEvent is MapEventMoveEnd && indexController.currentUser. length <= 0) {
|
||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
|
||||
indexController.loadLocationsBound();
|
||||
//indexController.rogMapController!.move(c.center, c.zoom);
|
||||
|
||||
Reference in New Issue
Block a user