This commit is contained in:
Hamza Aleghwairyeen
2024-03-27 17:27:14 +03:00
parent ed63445fc5
commit 112ba96f91
9 changed files with 161 additions and 76 deletions

View File

@@ -1,6 +1,5 @@
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/controller/firebase/firbase_messge.dart';
@@ -34,6 +33,8 @@ class OrderRequestPage extends StatelessWidget {
orderRequestController.startTimer(myList[6].toString(), body.toString());
var coords = myList[0].split(',');
var coordDestination = myList[1].split(',');
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
// Parse to double
double latPassengerLocation = double.parse(coords[0]);
@@ -59,6 +60,25 @@ class OrderRequestPage extends StatelessWidget {
southwest: LatLng(minLatitude, minLongitude),
northeast: LatLng(maxLatitude, maxLongitude),
);
// void addCustomStartIcon() async {
// Create the marker with the resized image
ImageConfiguration config = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png',
mipmaps: false)
.then((value) {
startIcon = value;
});
ImageConfiguration config1 = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config1, 'assets/images/b.png',
mipmaps: false)
.then((value) {
endIcon = value;
});
// }
return MyScafolld(
title: 'Order Details'.tr,
body: [
@@ -68,7 +88,7 @@ class OrderRequestPage extends StatelessWidget {
// SizedBox(height: 200, child: Text(pointsList.toString())),
// Text(message.notification!.body.toString()),
SizedBox(
height: 200,
height: Get.height * .2,
child: GoogleMap(
initialCameraPosition: CameraPosition(
zoom: 12,
@@ -81,21 +101,17 @@ class OrderRequestPage extends StatelessWidget {
myLocationEnabled: true,
markers: {
Marker(
markerId: MarkerId('MyLocation'.tr),
position:
LatLng(latPassengerLocation, lngPassengerLocation),
draggable: true,
icon: BitmapDescriptor.defaultMarkerWithHue(
BitmapDescriptor.hueGreen),
),
markerId: MarkerId('MyLocation'.tr),
position:
LatLng(latPassengerLocation, lngPassengerLocation),
draggable: true,
icon: startIcon),
Marker(
markerId: MarkerId('Destination'.tr),
position: LatLng(
latPassengerDestination, lngPassengerDestination),
draggable: true,
icon: BitmapDescriptor.defaultMarkerWithHue(
BitmapDescriptor.hueBlue),
),
markerId: MarkerId('Destination'.tr),
position: LatLng(
latPassengerDestination, lngPassengerDestination),
draggable: true,
icon: endIcon),
},
polylines: {
Polyline(
@@ -155,6 +171,78 @@ class OrderRequestPage extends StatelessWidget {
),
),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
double.parse(myList[2]).toStringAsFixed(2),
style: AppStyle.headTitle2,
)
// RichText(
// text: TextSpan(
// text: 'Total From Passenger is '.tr,
// style: AppStyle.title,
// children: [
// TextSpan(
// text: double.parse(myList[2]).toStringAsFixed(2),
// style: AppStyle.headTitle2),
// ],
// ),
// ),
),
),
Container(
height: Get.height * .15,
decoration: AppStyle.boxDecoration1,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Row(
children: [
const Icon(
Icons.arrow_circle_up,
color: AppColor.greenColor,
),
Text(myList[12] +
' ' +
'KM'.tr +
' ${myList[11]} ' +
'm'.tr),
],
),
Text(
myList[30],
style: AppStyle.title,
),
],
),
],
),
Row(
children: [
Row(
children: [
const Icon(
Icons.arrow_circle_down,
color: AppColor.redColor,
),
Text(myList[5] + ' ' + 'KM'.tr),
],
),
Text(
myList[31],
style: AppStyle.title,
),
],
),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: RichText(
@@ -167,50 +255,36 @@ class OrderRequestPage extends StatelessWidget {
),
),
),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: RichText(
// text: TextSpan(
// text: 'Duration To Passenger is '.tr,
// style: AppStyle.title,
// children: [
// TextSpan(
// text: myList[11].toString(),
// style: AppStyle.headTitle2),
// ],
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: RichText(
// text: TextSpan(
// text: 'Distance To Passenger is '.tr,
// style: AppStyle.title,
// children: [
// TextSpan(
// text: myList[12].toString(),
// style: AppStyle.headTitle2),
// ],
// ),
// ),
// ),
Padding(
padding: const EdgeInsets.all(8.0),
child: RichText(
text: TextSpan(
text: 'Total From Passenger is '.tr,
style: AppStyle.title,
children: [
TextSpan(
text: double.parse(myList[2]).toStringAsFixed(2),
style: AppStyle.headTitle2),
],
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: RichText(
text: TextSpan(
text: 'Duration To Passenger is '.tr,
style: AppStyle.title,
children: [
TextSpan(
text: myList[11].toString(),
style: AppStyle.headTitle2),
],
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: RichText(
text: TextSpan(
text: 'Distance To Passenger is '.tr,
style: AppStyle.title,
children: [
TextSpan(
text: myList[12].toString(),
style: AppStyle.headTitle2),
],
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(4),
child: Container(
color: AppColor.deepPurpleAccent,
child: RichText(