1/15/1
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/home/points_for_rider_controller.dart';
|
||||
import 'package:ride/views/home/map_page_passenger.dart';
|
||||
import 'package:ride/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
||||
import '../../constant/api_key.dart';
|
||||
@@ -77,6 +78,8 @@ class MapPassengerController extends GetxController {
|
||||
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor tripIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||
double height = 150;
|
||||
DateTime currentTime = DateTime.now();
|
||||
@@ -170,6 +173,7 @@ class MapPassengerController extends GetxController {
|
||||
List currentLocationToFormPlacesAll = [];
|
||||
late String driverToken;
|
||||
int carsOrder = 0;
|
||||
int wayPointIndex = 0;
|
||||
String? mapAPIKEY;
|
||||
late double totalME = 0;
|
||||
late double tax = 0;
|
||||
@@ -873,25 +877,22 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
void changeMainBottomMenuMap() {
|
||||
print(isWayPointStopsSheetUtilGetMap);
|
||||
if (isWayPointStopsSheetUtilGetMap == true) {
|
||||
isWayPointSheet = true;
|
||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||
update();
|
||||
} else {
|
||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||
mainBottomMenuMapHeight =
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||
if (heightMenuBool == true) {
|
||||
getDrawerMenu();
|
||||
}
|
||||
update();
|
||||
// else {
|
||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||
mainBottomMenuMapHeight =
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||
isWayPointSheet = false;
|
||||
if (heightMenuBool == true) {
|
||||
getDrawerMenu();
|
||||
}
|
||||
|
||||
update();
|
||||
// }
|
||||
}
|
||||
|
||||
void changeWayPointSheet() {
|
||||
isWayPointSheet = !isWayPointSheet;
|
||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .45;
|
||||
// if (heightMenuBool == true) {
|
||||
// getDrawerMenu();
|
||||
// }
|
||||
@@ -899,9 +900,14 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
void changeWayPointStopsSheet() {
|
||||
isWayPointStopsSheetUtilGetMap = true;
|
||||
int waypointsLength = Get.find<WayPointController>().wayPoints.length;
|
||||
print('isWayPointStopsSheet $waypointsLength');
|
||||
if (waypointsLength > 2) {
|
||||
isWayPointStopsSheet = true;
|
||||
isWayPointStopsSheetUtilGetMap = true;
|
||||
}
|
||||
isWayPointStopsSheet = !isWayPointStopsSheet;
|
||||
wayPointSheetHeight = isWayPointStopsSheet == false ? 0 : Get.height * .4;
|
||||
wayPointSheetHeight = isWayPointStopsSheet == false ? 0 : Get.height * .45;
|
||||
// if (heightMenuBool == true) {
|
||||
// getDrawerMenu();
|
||||
// }
|
||||
@@ -1082,13 +1088,24 @@ class MapPassengerController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
void addCustomTripIcon() {
|
||||
void addCustomStartIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: Size(Get.width * .6, Get.height * .6),
|
||||
);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/brand.png')
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png')
|
||||
.then((value) {
|
||||
tripIcon = value;
|
||||
startIcon = value;
|
||||
update();
|
||||
});
|
||||
}
|
||||
|
||||
void addCustomEndIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: Size(Get.width * .6, Get.height * .6),
|
||||
);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/b.png')
|
||||
.then((value) {
|
||||
endIcon = value;
|
||||
update();
|
||||
});
|
||||
}
|
||||
@@ -1395,14 +1412,14 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
int totalStepDurations = 0;
|
||||
getMapPoints(String origin, destination, int index) async {
|
||||
getMapPoints(String origin, String destination, int index) async {
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
await getCarsLocationByPassenger();
|
||||
isLoading = false;
|
||||
update();
|
||||
var url =
|
||||
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
||||
|
||||
print(url);
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
data = response['routes'][0]['legs'];
|
||||
// print(data);
|
||||
@@ -1676,7 +1693,8 @@ class MapPassengerController extends GetxController {
|
||||
getNearestDriverByPassengerLocation();
|
||||
addCustomPicker();
|
||||
addCustomCarIcon();
|
||||
addCustomTripIcon();
|
||||
addCustomStartIcon();
|
||||
addCustomEndIcon();
|
||||
startMarkerReloading();
|
||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user