first commit
This commit is contained in:
167
lib/views/admin/passenger/passenger_details_page.dart
Normal file
167
lib/views/admin/passenger/passenger_details_page.dart
Normal file
@@ -0,0 +1,167 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/admin/passenger_admin_controller.dart';
|
||||
import '../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
|
||||
class PassengerDetailsPage extends StatelessWidget {
|
||||
const PassengerDetailsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final arguments = Get.arguments;
|
||||
final Map<String, dynamic> data = arguments['data'];
|
||||
var key = Get.find<PassengerAdminController>().formPrizeKey;
|
||||
var titleNotify = Get.find<PassengerAdminController>().titleNotify;
|
||||
var bodyNotify = Get.find<PassengerAdminController>().bodyNotify;
|
||||
return MyScafolld(
|
||||
title: data['first_name'],
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Email is ${data['email']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Phone is ${data['phone']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'gender is ${data['gender']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'status is ${data['status']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'birthdate is ${data['birthdate']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'site is ${data['site']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'sosPhone is ${data['sosPhone']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Count Feedback is ${data['countFeedback']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Count Driver Rate is ${data['countDriverRate']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Count Cancel is ${data['countPassengerCancel']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Count Ride is ${data['countPassengerRide']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Rating Captain Avarage is ${data['passengerAverageRating']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Rating is ${data['ratingPassenger']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 3, color: AppColor.yellowColor)),
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Send Notification'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Form(
|
||||
key: key,
|
||||
child: Column(
|
||||
children: [
|
||||
MyTextForm(
|
||||
controller: titleNotify,
|
||||
label: 'title'.tr,
|
||||
hint: 'title notificaton'.tr,
|
||||
type: TextInputType.name),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: bodyNotify,
|
||||
label: 'body'.tr,
|
||||
hint: 'body notificaton'.tr,
|
||||
type: TextInputType.name)
|
||||
],
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Send',
|
||||
onPressed: () {
|
||||
if (key.currentState!.validate()) {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
titleNotify.text,
|
||||
bodyNotify.text,
|
||||
data['passengerToken'],
|
||||
'order.wav');
|
||||
Get.back();
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Text(
|
||||
"Send Notificaion to Passenger ".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user