This commit is contained in:
Hamza-Ayed
2024-06-25 15:08:56 +03:00
parent 9c73af74bb
commit 0407d37e9d
16 changed files with 513 additions and 493 deletions

View File

@@ -1,13 +1,16 @@
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/controller/profile/captain_profile_controller.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
class ProfileCaptain extends StatelessWidget {
const ProfileCaptain({super.key});
import '../my_wallet/walet_captain.dart';
class ProfileCaptain extends StatelessWidget {
ProfileCaptain({super.key});
CaptainWalletController captainWalletController = CaptainWalletController();
@override
Widget build(BuildContext context) {
Get.put(CaptainProfileController());
@@ -21,43 +24,77 @@ class ProfileCaptain extends StatelessWidget {
child: Center(
child: controller.isLoading
? const MyCircularProgressIndicator()
: DriverProfileCard(
driverId:
controller.captainProfileData['driverID'] ?? '',
name: controller.captainProfileData['first_name'] +
' ' +
(controller.captainProfileData['last_name'] ?? ''),
phoneNumber:
controller.captainProfileData['phone'] ?? '',
email: controller.captainProfileData['email'] ?? '',
birthdate:
controller.captainProfileData['birthdate'] ?? '',
gender: controller.captainProfileData['gender'] ?? '',
education:
controller.captainProfileData['education'] ?? '',
carMake: controller.captainProfileData['make'] ?? '',
carModel: controller.captainProfileData['model'] ?? '',
carPlate:
controller.captainProfileData['car_plate'] ?? '',
carColor: controller.captainProfileData['color'] ?? '',
vin: controller.captainProfileData['vin'] ?? '',
registrationDate: controller
.captainProfileData['registration_date'] ??
'',
expirationDate:
controller.captainProfileData['expiration_date'] ??
'',
ratingCount:
controller.captainProfileData['ratingCount'] ?? 0,
ratingDriver:
controller.captainProfileData['ratingDriver'] !=
null
? double.tryParse(controller
.captainProfileData['ratingDriver']
.toString()) ??
0
: null,
age: controller.captainProfileData['age'] ?? 0,
: Column(
children: [
Container(
decoration: AppStyle.boxDecoration1,
child: InkWell(
onTap: () async {
addBankCodeEgypt(captainWalletController);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Add bank Account'.tr,
style: AppStyle.title,
),
),
),
),
SizedBox(
height: Get.height * .8,
child: DriverProfileCard(
driverId:
controller.captainProfileData['driverID'] ??
'',
name: controller
.captainProfileData['first_name'] +
' ' +
(controller.captainProfileData['last_name'] ??
''),
phoneNumber:
controller.captainProfileData['phone'] ?? '',
email:
controller.captainProfileData['email'] ?? '',
birthdate:
controller.captainProfileData['birthdate'] ??
'',
gender:
controller.captainProfileData['gender'] ?? '',
education:
controller.captainProfileData['education'] ??
'',
carMake:
controller.captainProfileData['make'] ?? '',
carModel:
controller.captainProfileData['model'] ?? '',
carPlate:
controller.captainProfileData['car_plate'] ??
'',
carColor:
controller.captainProfileData['color'] ?? '',
vin: controller.captainProfileData['vin'] ?? '',
registrationDate: controller.captainProfileData[
'registration_date'] ??
'',
expirationDate: controller
.captainProfileData['expiration_date'] ??
'',
ratingCount: controller
.captainProfileData['ratingCount'] ??
0,
ratingDriver: controller
.captainProfileData['ratingDriver'] !=
null
? double.tryParse(controller
.captainProfileData['ratingDriver']
.toString()) ??
0
: null,
age: controller.captainProfileData['age'] ?? 0,
),
),
],
),
),
),
@@ -65,63 +102,6 @@ class ProfileCaptain extends StatelessWidget {
)
],
isleading: true,
// action: GetBuilder<CaptainProfileController>(
// builder: (controller) => IconButton(
// onPressed: () {
// Get.defaultDialog(
// title: 'Edit Your data'.tr,
// titleStyle: AppStyle.title,
// content: SizedBox(
// height: Get.height * .4,
// child: SingleChildScrollView(
// child: Column(
// children: [
// MyTextForm(
// controller: controller.vin,
// hint: 'write vin for your car'.tr,
// label: 'VIN'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.color,
// hint: 'write Color for your car'.tr,
// label: 'Color'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.make,
// hint: 'write Make for your car'.tr,
// label: 'Make'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.model,
// hint: 'write Model for your car'.tr,
// label: 'Model'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.year,
// hint: 'write Year for your car'.tr,
// label: 'Year'.tr,
// type: TextInputType.number,
// ),
// MyTextForm(
// controller: controller.expirationDate,
// hint: 'write Expiration Date for your car'.tr,
// label: 'Expiration Date'.tr,
// type: TextInputType.datetime),
// MyElevatedButton(
// title: 'Update'.tr,
// onPressed: () => controller.updateFields())
// ],
// ),
// ),
// ));
// },
// icon: const Icon(Icons.edit),
// ),
// )
);
}
}
@@ -167,175 +147,178 @@ class DriverProfileCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
elevation: 8,
return Container(
// elevation: 8,
decoration: AppStyle.boxDecoration1,
margin: const EdgeInsets.all(16),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
style: AppStyle.title,
name,
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.phone),
const SizedBox(width: 8),
Text(style: AppStyle.title, phoneNumber),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'birthdate'.tr} : $birthdate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.wc),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'gender'.tr} : $gender',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.school),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'education'.tr} : $education',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.car_repair),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'Make'.tr} : $carMake',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.model_training),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_model'.tr} : $carModel',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.drive_eta),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_plate'.tr} : $carPlate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.color_lens),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_color'.tr} : $carColor',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.confirmation_number),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'vin'.tr} : $vin',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'registration_date'.tr} : $registrationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'expiration_date'.tr} : $expirationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'rating_count'.tr} : $ratingCount',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star_rate),
const SizedBox(width: 8),
ratingDriver != null
? Text(
style: AppStyle.title,
'${'rating_driver'.tr} : $ratingDriver',
)
: Text(
style: AppStyle.title,
'${'rating_driver'.tr} : 0',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.person),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'age'.tr} : $age',
),
],
),
],
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
style: AppStyle.title,
name,
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.phone),
const SizedBox(width: 8),
Text(style: AppStyle.title, phoneNumber),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'birthdate'.tr} : $birthdate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.wc),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'gender'.tr} : $gender',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.school),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'education'.tr} : $education',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.car_repair),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'Make'.tr} : $carMake',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.model_training),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_model'.tr} : $carModel',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.drive_eta),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_plate'.tr} : $carPlate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.color_lens),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_color'.tr} : $carColor',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.confirmation_number),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'vin'.tr} : $vin',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'registration_date'.tr} : $registrationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'expiration_date'.tr} : $expirationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'rating_count'.tr} : $ratingCount',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star_rate),
const SizedBox(width: 8),
ratingDriver != null
? Text(
style: AppStyle.title,
'${'rating_driver'.tr} : $ratingDriver',
)
: Text(
style: AppStyle.title,
'${'rating_driver'.tr} : 0',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.person),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'age'.tr} : $age',
),
],
),
],
),
),
),
);