4/18/1
This commit is contained in:
@@ -37,26 +37,29 @@ class OrderHistory extends StatelessWidget {
|
||||
itemCount: orderHistoryController
|
||||
.orderHistoryListPassenger.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final rides = orderHistoryController
|
||||
.orderHistoryListPassenger[index];
|
||||
// Use integer index here
|
||||
final rides =
|
||||
orderHistoryController.orderHistoryListPassenger[
|
||||
index]; // Access data using index
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
String mapUrl =
|
||||
'https://www.google.com/maps/dir/${rides['start_location']}/${rides['end_location']}/';
|
||||
// print(mapUrl);
|
||||
showInBrowser(mapUrl);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
String mapUrl =
|
||||
'https://www.google.com/maps/dir/${rides['start_location']}/${rides['end_location']}/';
|
||||
// print(mapUrl);
|
||||
showInBrowser(mapUrl);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .2,
|
||||
width: Get.width * .75,
|
||||
child: GoogleMap(
|
||||
@@ -66,6 +69,8 @@ class OrderHistory extends StatelessWidget {
|
||||
.passengerLocation, // Assuming passenger location is available
|
||||
zoom: 15,
|
||||
),
|
||||
zoomControlsEnabled: true,
|
||||
liteModeEnabled: true,
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
@@ -78,15 +83,25 @@ class OrderHistory extends StatelessWidget {
|
||||
const PolylineId('route'),
|
||||
points: [
|
||||
LatLng(
|
||||
rides['start_location']
|
||||
['latitude'],
|
||||
rides['start_location']
|
||||
['longitude']),
|
||||
double.parse(
|
||||
rides['start_location']
|
||||
.toString()
|
||||
.split(',')[0]),
|
||||
double.parse(
|
||||
rides['start_location']
|
||||
.toString()
|
||||
.split(',')[1]),
|
||||
),
|
||||
LatLng(
|
||||
rides['end_location']
|
||||
['latitude'],
|
||||
rides['end_location']
|
||||
['longitude']),
|
||||
double.parse(
|
||||
rides['end_location']
|
||||
.toString()
|
||||
.split(',')[0]),
|
||||
double.parse(
|
||||
rides['end_location']
|
||||
.toString()
|
||||
.split(',')[1]),
|
||||
)
|
||||
],
|
||||
color: AppColor.primaryColor,
|
||||
width: 5,
|
||||
@@ -94,32 +109,35 @@ class OrderHistory extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
rides['date'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
rides['time'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
rides['status'],
|
||||
style: rides['status'] != 'Canceled'.tr
|
||||
? AppStyle.subtitle.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: AppStyle.subtitle.copyWith(
|
||||
color: AppColor.redColor),
|
||||
),
|
||||
Text(
|
||||
'${'Price is'.tr} ${rides['price']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
rides['date'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
rides['time'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
rides['status'],
|
||||
style: rides['status'] !=
|
||||
'Canceled'.tr
|
||||
? AppStyle.subtitle.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: AppStyle.subtitle.copyWith(
|
||||
color: AppColor.redColor),
|
||||
),
|
||||
Text(
|
||||
'${'Price is'.tr} ${rides['price']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user