update initial map loading
This commit is contained in:
@ -6,6 +6,7 @@ import 'dart:io';
|
||||
import 'package:camera_camera/camera_camera.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -19,7 +20,10 @@ import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/action_service.dart';
|
||||
import 'package:rogapp/services/destination_service.dart';
|
||||
import 'package:rogapp/services/external_service.dart';
|
||||
import 'package:rogapp/services/location_line_service.dart';
|
||||
import 'package:rogapp/services/location_service.dart';
|
||||
import 'package:rogapp/services/maxtrix_service.dart';
|
||||
import 'package:rogapp/services/perfecture_service.dart';
|
||||
import 'package:rogapp/services/reacking_service.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
@ -434,6 +438,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
|
||||
checkPermission();
|
||||
PopulateDestinations();
|
||||
|
||||
@ -505,6 +510,33 @@ class DestinationController extends GetxController {
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
Get.toNamed(AppPages.LOGIN)!.then((value){
|
||||
if(indexController.currentUser.length > 0) {
|
||||
Get.toNamed(AppPages.INITIAL);
|
||||
LocationService.getLocationsExt().then((value) {
|
||||
if(value != null){
|
||||
print("--- loc ext is - ${value} ----");
|
||||
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
|
||||
print("--- bnds is - ${bnds} ----");
|
||||
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
PerfectureService.getSubExt("9").then((value){
|
||||
if(value != null){
|
||||
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
|
||||
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
void connectionChanged(String val) {
|
||||
print('----- %%%%%%%%%%%%%%%%%%%%% ----- ${val}');
|
||||
Map<String, dynamic> _res = {};
|
||||
|
||||
Reference in New Issue
Block a user