8-12/
This commit is contained in:
@@ -4,7 +4,6 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/controller/home/map_page_controller.dart';
|
||||
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/home/menu_controller.dart';
|
||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||
import 'map_widget.dart/map_menu_widget.dart';
|
||||
@@ -22,88 +21,99 @@ class MapPage extends StatelessWidget {
|
||||
body: Stack(
|
||||
children: [
|
||||
GetBuilder<MapController>(
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
onLongPress: (argument) {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go to this site',
|
||||
content: Column(
|
||||
children: [
|
||||
Text('${argument.latitude},${argument.longitude}'),
|
||||
],
|
||||
builder: (controller) => controller.isloading
|
||||
? const Center(
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
)
|
||||
: GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
cameraTargetBounds:
|
||||
CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
onLongPress: (argument) {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go to this site',
|
||||
content: Column(
|
||||
children: [
|
||||
Text('${argument.latitude},${argument.longitude}'),
|
||||
],
|
||||
),
|
||||
onConfirm: () async {
|
||||
controller.clearpolyline();
|
||||
await controller.getMap(
|
||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||
'${argument.latitude.toString()},${argument.longitude.toString()}');
|
||||
|
||||
Get.back();
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
);
|
||||
},
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: controller.mylocation,
|
||||
zoom: 15,
|
||||
),
|
||||
markers: {
|
||||
for (var carLocation
|
||||
in controller.carsLocationByPassenger)
|
||||
Marker(
|
||||
position: carLocation,
|
||||
icon: controller.carIcon,
|
||||
markerId: MarkerId(carLocation.toString())),
|
||||
Marker(
|
||||
markerId: const MarkerId('MyLocation'),
|
||||
position: controller.mylocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
infoWindow: const InfoWindow(title: 'my location'),
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('destination'),
|
||||
position: controller.mydestination,
|
||||
draggable: true,
|
||||
onDragEnd: (v) {
|
||||
print(v);
|
||||
},
|
||||
),
|
||||
},
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route'),
|
||||
points: controller.polylineCoordinates,
|
||||
color: AppColor.primaryColor,
|
||||
width: 5,
|
||||
),
|
||||
},
|
||||
mapType: MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
indoorViewEnabled: true,
|
||||
trafficEnabled: true,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
controller.newMylocation = position.target;
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
onConfirm: () async {
|
||||
controller.clearpolyline();
|
||||
await controller.getMap(
|
||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||
'${argument.latitude.toString()},${argument.longitude.toString()}');
|
||||
|
||||
Get.back();
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
);
|
||||
},
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: controller.mylocation,
|
||||
zoom: 15,
|
||||
),
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: const MarkerId('MyLocation'),
|
||||
position: controller.mylocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
infoWindow: const InfoWindow(title: 'my location'),
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('destination'),
|
||||
position: controller.mydestination,
|
||||
draggable: true,
|
||||
onDragEnd: (v) {
|
||||
print(v);
|
||||
},
|
||||
),
|
||||
},
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route'),
|
||||
points: controller.polylineCoordinates,
|
||||
color: AppColor.primaryColor,
|
||||
width: 5,
|
||||
),
|
||||
},
|
||||
mapType: MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
indoorViewEnabled: true,
|
||||
trafficEnabled: true,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
controller.newMylocation = position.target;
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
const PickerIconOnMap(),
|
||||
PickerAnimtionContainer(),
|
||||
|
||||
Reference in New Issue
Block a user