10/10/1
This commit is contained in:
120
lib/views/orderCaptin/driver_map_page.dart
Normal file
120
lib/views/orderCaptin/driver_map_page.dart
Normal file
@@ -0,0 +1,120 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:ride/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/functions/launch.dart';
|
||||
import '../../controller/functions/location_controller.dart';
|
||||
import '../home/map_widget.dart/passenger_info_window.dart';
|
||||
import '../home/map_widget.dart/timer_to_passenger_from_driver.dart';
|
||||
|
||||
class PassengerLocationDirection extends StatelessWidget {
|
||||
PassengerLocationDirection({super.key});
|
||||
final LocationController locationController = Get.put(LocationController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapDriverController());
|
||||
|
||||
// mapDirection.getMap();//todo get this argument
|
||||
return MyScafolld(
|
||||
title: 'Map'.tr,
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<MapDriverController>(
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
// onCameraMove: (position) {
|
||||
// locationController.myLocation = position.target;
|
||||
// print(position);
|
||||
// },
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
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.greenColor,
|
||||
width: 5,
|
||||
),
|
||||
},
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: MarkerId('MyLocation'.tr),
|
||||
position: locationController.myLocation,
|
||||
draggable: true,
|
||||
icon: controller.carIcon,
|
||||
infoWindow: const InfoWindow(
|
||||
title: 'Time',
|
||||
// snippet: controller.durationFromDriverToPassenger
|
||||
// .toString(),
|
||||
),
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const PassengerInfoWindow(),
|
||||
GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController
|
||||
.isRideFinished
|
||||
? Positioned(
|
||||
left: 5,
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: 60,
|
||||
width: 200,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.social_distance),
|
||||
Text(
|
||||
mapDriverController.distance.toString() +
|
||||
' ' +
|
||||
'KM'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.timelapse),
|
||||
Text(
|
||||
mapDriverController.duration.toString() +
|
||||
' ' +
|
||||
'Minute'.tr,
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
: const SizedBox())
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user