114 lines
4.1 KiB
Dart
114 lines
4.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:ride/views/widgets/my_scafold.dart';
|
|
|
|
import '../../constant/colors.dart';
|
|
import '../../constant/links.dart';
|
|
import '../../constant/style.dart';
|
|
import '../../controller/functions/crud.dart';
|
|
import '../../controller/functions/launch.dart';
|
|
import '../widgets/elevated_btn.dart';
|
|
|
|
class OrderRequestPage extends StatelessWidget {
|
|
const OrderRequestPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final arguments = Get.arguments;
|
|
final myListString = arguments['myListString'];
|
|
final myList = arguments['myList'];
|
|
final body = arguments['body'];
|
|
return MyScafolld(
|
|
title: 'Order Request Page',
|
|
body: [
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Text(message.notification!.body.toString()),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: TextButton.icon(
|
|
onPressed: () {
|
|
String mapUrl =
|
|
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/';
|
|
print(mapUrl);
|
|
launchUrl1(mapUrl);
|
|
},
|
|
icon: const Icon(Icons.map),
|
|
label: Text('Rouats of Trip'.tr)),
|
|
),
|
|
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
'Tatal From Passenger is '.tr +
|
|
double.parse(myList[2]).toStringAsFixed(2),
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
'Tatal For You is '.tr +
|
|
double.parse(myList[3]).toStringAsFixed(2),
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
'Distance is '.tr + myList[5].toString() + ' KM'.tr,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
'Duration of Trip is '.tr +
|
|
myList[4].toString() +
|
|
' Minutes'.tr,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
MyElevatedButton(
|
|
title: 'Apply Order'.tr,
|
|
onPressed: () async {
|
|
await CRUD().postFromDialogue(
|
|
link: AppLink.addDriverOrder,
|
|
payload: {
|
|
'driver_id': myList[6].toString(),
|
|
// box.read(BoxName.driverID).toString(),
|
|
'order_id': body.toString(),
|
|
'status': 'Apply'
|
|
});
|
|
},
|
|
),
|
|
MyElevatedButton(
|
|
title: 'Refuse Order'.tr,
|
|
onPressed: () async {
|
|
await CRUD().postFromDialogue(
|
|
link: AppLink.addDriverOrder,
|
|
payload: {
|
|
'driver_id': myList[6].toString(),
|
|
// box.read(BoxName.driverID).toString(),
|
|
'order_id': body.toString(),
|
|
'status': 'Refused'
|
|
});
|
|
},
|
|
kolor: AppColor.redColor,
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
isleading: true);
|
|
}
|
|
}
|