10/18/1
This commit is contained in:
@@ -98,15 +98,18 @@ class HomeCaptain extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'You Earn today is '.tr, //Todo add here number for income
|
||||
style: AppStyle.title,
|
||||
)),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'You Earn today is '.tr +
|
||||
homeCaptainController
|
||||
.totalToday, //Todo add here number for income
|
||||
style: AppStyle.title,
|
||||
))),
|
||||
),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Column(
|
||||
|
||||
83
lib/views/home/Captin/mapDriver/driver_end_ride_bar.dart
Normal file
83
lib/views/home/Captin/mapDriver/driver_end_ride_bar.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||
import '../../../widgets/elevated_btn.dart';
|
||||
|
||||
GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
return GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
left: 5,
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: 100,
|
||||
width: 200,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.social_distance),
|
||||
Text(
|
||||
mapDriverController.distance.toString() +
|
||||
' ' +
|
||||
'KM'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? MyElevatedButton(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {
|
||||
mapDriverController.finishRideFromDriver();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(),
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.timelapse),
|
||||
Text(
|
||||
mapDriverController.duration.toString() +
|
||||
' ' +
|
||||
'Minute'.tr,
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color:
|
||||
mapDriverController.remainingTimeTimerRideBegin <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 40,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: mapDriverController.progressTimerRideBegin
|
||||
.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
mapDriverController.stringRemainingTimeRideBegin,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
: const SizedBox());
|
||||
}
|
||||
27
lib/views/home/Captin/mapDriver/driver_map_page.dart
Normal file
27
lib/views/home/Captin/mapDriver/driver_map_page.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../../controller/functions/location_controller.dart';
|
||||
import 'driver_end_ride_bar.dart';
|
||||
import 'google_driver_map_page.dart';
|
||||
import 'passenger_info_window.dart';
|
||||
|
||||
class PassengerLocationMapPage extends StatelessWidget {
|
||||
PassengerLocationMapPage({super.key});
|
||||
final LocationController locationController = Get.put(LocationController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapDriverController());
|
||||
|
||||
return MyScafolld(
|
||||
title: 'Map'.tr,
|
||||
body: [
|
||||
GoogleDriverMap(locationController: locationController),
|
||||
const PassengerInfoWindow(),
|
||||
driverEndRideBar()
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
66
lib/views/home/Captin/mapDriver/google_driver_map_page.dart
Normal file
66
lib/views/home/Captin/mapDriver/google_driver_map_page.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../controller/functions/location_controller.dart';
|
||||
import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||
|
||||
class GoogleDriverMap extends StatelessWidget {
|
||||
const GoogleDriverMap({
|
||||
super.key,
|
||||
required this.locationController,
|
||||
});
|
||||
|
||||
final LocationController locationController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return 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(),
|
||||
),
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ import 'package:ride/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/launch.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
|
||||
class PassengerInfoWindow extends StatelessWidget {
|
||||
const PassengerInfoWindow({
|
||||
Reference in New Issue
Block a user