25-8-9-1
This commit is contained in:
371
lib/views/auth/syria/registration_view.dart
Normal file
371
lib/views/auth/syria/registration_view.dart
Normal file
@@ -0,0 +1,371 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../controller/auth/syria/registration_controller.dart';
|
||||
|
||||
class RegistrationView extends StatelessWidget {
|
||||
const RegistrationView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final RegistrationController controller = Get.put(RegistrationController());
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Driver Registration'.tr),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 90,
|
||||
child: Obx(
|
||||
() => Stepper(
|
||||
currentStep: controller.currentPage.value,
|
||||
type: StepperType.horizontal,
|
||||
controlsBuilder: (_, __) => const SizedBox.shrink(),
|
||||
steps: [
|
||||
Step(
|
||||
title: Text('Driver'.tr),
|
||||
content: const SizedBox.shrink()),
|
||||
Step(
|
||||
title: Text('Vehicle'.tr),
|
||||
content: const SizedBox.shrink()),
|
||||
Step(
|
||||
title: Text('Docs'.tr), content: const SizedBox.shrink()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
controller: controller.pageController,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
onPageChanged: (i) => controller.currentPage.value = i,
|
||||
children: [
|
||||
_buildDriverInfoStep(context, controller),
|
||||
_buildCarInfoStep(context, controller),
|
||||
_buildDocumentUploadStep(context, controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: _buildBottomNavBar(controller),
|
||||
);
|
||||
}
|
||||
|
||||
// STEP 1
|
||||
Widget _buildDriverInfoStep(BuildContext ctx, RegistrationController c) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Form(
|
||||
key: c.driverInfoFormKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Driver's Personal Information".tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
TextFormField(
|
||||
controller: c.firstNameController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'First Name'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.lastNameController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Last Name'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.nationalIdController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'National ID Number'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
keyboardType: TextInputType.number,
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.driverLicenseExpiryController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'License Expiry Date'.tr,
|
||||
hintText: 'YYYY-MM-DD'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
DateTime? d = await showDatePicker(
|
||||
context: ctx,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime(2101),
|
||||
);
|
||||
if (d != null) {
|
||||
c.driverLicenseExpiryDate = d;
|
||||
c.driverLicenseExpiryController.text =
|
||||
d.toLocal().toString().split(' ')[0];
|
||||
}
|
||||
},
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Please select a date'.tr : null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// STEP 2
|
||||
Widget _buildCarInfoStep(BuildContext ctx, RegistrationController c) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Form(
|
||||
key: c.carInfoFormKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Vehicle Information'.tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
TextFormField(
|
||||
controller: c.carPlateController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Car Plate Number'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.carMakeController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Car Make (e.g., Toyota)'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.carModelController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Car Model (e.g., Corolla)'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.carYearController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Year of Manufacture'.tr,
|
||||
border: const OutlineInputBorder()),
|
||||
validator: (v) =>
|
||||
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// حقل اسم اللون (يبقى اختياري أو نملؤه تلقائيًا عند اختيار الهكس)
|
||||
// TextFormField(
|
||||
// controller: c.carColorController,
|
||||
// decoration: InputDecoration(
|
||||
// labelText: 'Car Color (Name)'.tr,
|
||||
// border: const OutlineInputBorder(),
|
||||
// ),
|
||||
// validator: (v) =>
|
||||
// (v?.isEmpty ?? true) ? 'Required field'.tr : null,
|
||||
// ),
|
||||
// const SizedBox(height: 16),
|
||||
|
||||
// الدروب داون للهكس + دائرة اللون
|
||||
GetBuilder<RegistrationController>(
|
||||
id: 'carColor', // اختياري لتحديث انتقائي
|
||||
builder: (c) {
|
||||
return DropdownButtonFormField<String>(
|
||||
value: (c.colorHex != null && c.colorHex!.isNotEmpty)
|
||||
? c.colorHex
|
||||
: null,
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Car Color (Hex)'.tr,
|
||||
border: const OutlineInputBorder(),
|
||||
// prefixIcon: Padding(
|
||||
// padding:
|
||||
// const EdgeInsetsDirectional.only(start: 12, end: 8),
|
||||
// child: Container(
|
||||
// width: 18,
|
||||
// height: 18,
|
||||
// decoration: BoxDecoration(
|
||||
// color: (c.colorHex?.isNotEmpty ?? false)
|
||||
// ? c.hexToColor(c.colorHex!)
|
||||
// : Colors.transparent,
|
||||
// shape: BoxShape.circle,
|
||||
// border: Border.all(color: Colors.black26),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
items: RegistrationController.kCarColorOptions.map((opt) {
|
||||
final hex = opt['hex']!;
|
||||
final key = opt['key']!;
|
||||
return DropdownMenuItem<String>(
|
||||
value: hex,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 18,
|
||||
height: 18,
|
||||
decoration: BoxDecoration(
|
||||
color: c.hexToColor(hex),
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.black12),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Text(key.tr)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (hex) {
|
||||
c.colorHex = hex; // خزّن الهكس
|
||||
final key = RegistrationController.kCarColorOptions
|
||||
.firstWhere((o) => o['hex'] == hex)['key']!;
|
||||
c.carColorController.text = key.tr;
|
||||
c.update([
|
||||
'carColor'
|
||||
]); // <-- مهم: يعيد بناء الودجت ويحدّث الدائرة
|
||||
},
|
||||
validator: (v) =>
|
||||
(v == null || v.isEmpty) ? 'Required field'.tr : null,
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// STEP 3
|
||||
Widget _buildDocumentUploadStep(BuildContext ctx, RegistrationController c) {
|
||||
return GetBuilder<RegistrationController>(
|
||||
builder: (ctrl) => SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Upload Documents'.tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
_buildImagePickerBox(
|
||||
'Driver License (Front)'.tr,
|
||||
ctrl.driverLicenseFrontImage,
|
||||
() => ctrl.pickImage(ImageType.driverLicenseFront),
|
||||
),
|
||||
_buildImagePickerBox(
|
||||
'Driver License (Back)'.tr,
|
||||
ctrl.driverLicenseBackImage,
|
||||
() => ctrl.pickImage(ImageType.driverLicenseBack),
|
||||
),
|
||||
_buildImagePickerBox(
|
||||
'Car Registration (Front)'.tr,
|
||||
ctrl.carLicenseFrontImage,
|
||||
() => ctrl.pickImage(ImageType.carLicenseFront),
|
||||
),
|
||||
_buildImagePickerBox(
|
||||
'Car Registration (Back)'.tr,
|
||||
ctrl.carLicenseBackImage,
|
||||
() => ctrl.pickImage(ImageType.carLicenseBack),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildImagePickerBox(String title, File? img, VoidCallback onTap) {
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 16),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: SizedBox(
|
||||
height: 150,
|
||||
width: double.infinity,
|
||||
child: img != null
|
||||
? Image.file(img, fit: BoxFit.fill)
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.camera_alt_outlined,
|
||||
size: 40, color: Colors.grey[600]),
|
||||
const SizedBox(height: 8),
|
||||
Text(title, style: TextStyle(color: Colors.grey[700])),
|
||||
Text('Tap to upload'.tr,
|
||||
style:
|
||||
const TextStyle(color: Colors.grey, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomNavBar(RegistrationController c) {
|
||||
return Obx(() => Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (c.currentPage.value > 0)
|
||||
TextButton(
|
||||
onPressed: c.goToPreviousStep,
|
||||
child: Text('<< BACK'.tr),
|
||||
),
|
||||
const Spacer(),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 40, vertical: 12),
|
||||
backgroundColor: c.currentPage.value == 2
|
||||
? Colors.green
|
||||
: Theme.of(Get.context!).primaryColor,
|
||||
),
|
||||
onPressed: c.isLoading.value
|
||||
? null
|
||||
: () {
|
||||
if (c.currentPage.value == 2) {
|
||||
c.submitRegistration();
|
||||
} else {
|
||||
c.goToNextStep();
|
||||
}
|
||||
},
|
||||
child: c.isLoading.value
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white, strokeWidth: 2))
|
||||
: Text(
|
||||
c.currentPage.value == 2 ? 'SUBMIT'.tr : 'NEXT >>'.tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 16, color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class VideoPlayerPage extends StatelessWidget {
|
||||
class VideoPlayerPage1 extends StatelessWidget {
|
||||
final String videoUrl;
|
||||
|
||||
VideoPlayerPage1({required this.videoUrl});
|
||||
const VideoPlayerPage1({required this.videoUrl});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/constant/links.dart';
|
||||
import 'package:sefer_driver/controller/functions/upload_image.dart';
|
||||
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:sefer_driver/device_compatibility_page.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
|
||||
// استيراد الصفحات الأخرى... تأكد من صحة المسارات
|
||||
@@ -105,6 +106,11 @@ class AppDrawer extends StatelessWidget {
|
||||
icon: Icons.star,
|
||||
color: Colors.amber,
|
||||
onTap: () => Get.to(() => RatingScreen())),
|
||||
DrawerItem(
|
||||
title: 'Is device compatible'.tr,
|
||||
icon: Icons.memory,
|
||||
color: Colors.greenAccent,
|
||||
onTap: () => Get.to(() => DeviceCompatibilityPage())),
|
||||
DrawerItem(
|
||||
title: 'Settings'.tr,
|
||||
icon: Icons.settings,
|
||||
@@ -228,7 +234,10 @@ class UserHeader extends StatelessWidget {
|
||||
fontSize: 18,
|
||||
shadows: [Shadow(blurRadius: 2, color: Colors.black26)]),
|
||||
),
|
||||
accountEmail: Text(box.read(BoxName.emailDriver)),
|
||||
accountEmail:
|
||||
box.read(BoxName.emailDriver).toString().contains('intaleqapp')
|
||||
? Text('Your email not updated yet'.tr)
|
||||
: Text(box.read(BoxName.emailDriver)),
|
||||
currentAccountPicture: GetBuilder<ImageController>(
|
||||
builder: (controller) => Stack(
|
||||
clipBehavior: Clip.none,
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/auth/captin/login_captin.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/driver_map_page.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:sefer_driver/views/home/my_wallet/points_captain.dart';
|
||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../constant/links.dart';
|
||||
import '../../../../../controller/auth/google_sign.dart';
|
||||
import '../../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../../controller/functions/crud.dart';
|
||||
import '../../../../../controller/home/captin/order_request_controller.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../auth/captin/otp_page.dart';
|
||||
import '../../../my_wallet/ecash.dart';
|
||||
import '../../../../auth/syria/registration_view.dart';
|
||||
|
||||
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
final firebaseMessagesController =
|
||||
@@ -150,35 +146,28 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// height: 5,
|
||||
// ),
|
||||
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(color: AppColor.blueColor),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// Get.to(PhoneNumberScreen());
|
||||
// // payWithEcashDriver(context, '2000');
|
||||
// // payWithMTNWallet(context, '1', 'SYP');
|
||||
// // firebaseMessagesController.sendNotificationToDriverMAP(
|
||||
// // 'title',
|
||||
// // DateTime.now().toString(),
|
||||
// // 'ffX7xVXpdE_Xq8JBH3lgS4:APA91bGBHp53E-ZuXdlLBpRZohzqR9sazqcn3pwpEDG7JxkVi9MBtFDlCipzLpPCvD6LHEtds88ugGyCty7pEJVyx6tQYvzHVDCh7l3_7axpyriTBs5iv9E',
|
||||
// // [],
|
||||
// // '');
|
||||
// // box.write(BoxName.statusDriverLocation, 'off');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.grin_tears,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),f
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.blueColor),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
Get.to(() => const RegistrationView());
|
||||
|
||||
// box.write(BoxName.statusDriverLocation, 'off');
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.grin_tears,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
|
||||
@@ -1,310 +1,3 @@
|
||||
// import 'dart:io';
|
||||
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:slide_to_act/slide_to_act.dart';
|
||||
// import 'package:vibration/vibration.dart';
|
||||
|
||||
// import '../../../../constant/colors.dart';
|
||||
// import '../../../../constant/style.dart';
|
||||
// import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||
// import '../../../widgets/elevated_btn.dart';
|
||||
|
||||
// GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
// return GetBuilder<MapDriverController>(
|
||||
// builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
// ? Positioned(
|
||||
// left: 5,
|
||||
// top: 5,
|
||||
// right: 5,
|
||||
// child: Container(
|
||||
// decoration: AppStyle.boxDecoration1.copyWith(
|
||||
// borderRadius: BorderRadius.circular(15),
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// color: Colors.black.withOpacity(0.1),
|
||||
// blurRadius: 10,
|
||||
// offset: Offset(0, 5),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// padding: const EdgeInsets.all(10),
|
||||
// height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
// ? mapDriverController.driverEndPage = 190
|
||||
// : mapDriverController.carType == 'Mishwar Vip'
|
||||
// ? 120
|
||||
// : 170,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// if (mapDriverController.carType != 'Mishwar Vip')
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
// children: [
|
||||
// _buildInfoColumn(
|
||||
// icon: Icons.social_distance,
|
||||
// text: '${mapDriverController.distance} ${'KM'.tr}',
|
||||
// ),
|
||||
// _buildInfoColumn(
|
||||
// icon: Icons.timelapse,
|
||||
// text: mapDriverController.hours > 1
|
||||
// ? '${mapDriverController.hours} ${'H and'.tr} ${mapDriverController.minutes} m'
|
||||
// : '${mapDriverController.minutes} ${'m'.tr}',
|
||||
// ),
|
||||
// _buildInfoColumn(
|
||||
// icon: Icons.money_sharp,
|
||||
// text:
|
||||
// '${mapDriverController.paymentAmount} ${'\$'.tr}',
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// if (mapDriverController.carType != 'Speed' &&
|
||||
// mapDriverController.carType != 'Awfar Car' &&
|
||||
// mapDriverController.carType != 'Scooter')
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// _buildInfoBox(
|
||||
// icon: Icons.timer,
|
||||
// text:
|
||||
// mapDriverController.stringRemainingTimeRideBegin1,
|
||||
// ),
|
||||
// _buildInfoBox(
|
||||
// icon: Icons.location_on,
|
||||
// text:
|
||||
// '${mapDriverController.recentDistanceToDash.toStringAsFixed(0)} ${'KM'.tr}',
|
||||
// ),
|
||||
// _buildInfoBox(
|
||||
// icon: Icons.attach_money,
|
||||
// text: mapDriverController.price.toStringAsFixed(2),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// _builtTimerAndCarType(),
|
||||
// Container(
|
||||
// width: Get.width * 0.8,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(15),
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// color: AppColor.redColor.withOpacity(0.3),
|
||||
// blurRadius: 8,
|
||||
// offset: Offset(0, 4),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// child: SlideAction(
|
||||
// height: 50,
|
||||
// borderRadius: 15,
|
||||
// elevation: 4,
|
||||
// text: 'Slide to End Trip'.tr,
|
||||
// textStyle: AppStyle.title.copyWith(
|
||||
// fontSize: 18,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// outerColor: AppColor.redColor,
|
||||
// innerColor: Colors.white,
|
||||
// sliderButtonIcon: const Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: AppColor.redColor,
|
||||
// size: 24,
|
||||
// ),
|
||||
// sliderRotate: false,
|
||||
// onSubmit: () {
|
||||
// HapticFeedback.mediumImpact();
|
||||
// mapDriverController.finishRideFromDriver();
|
||||
// },
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
// );
|
||||
// }
|
||||
|
||||
// class _builtTimerAndCarType extends StatelessWidget {
|
||||
// const _builtTimerAndCarType({
|
||||
// super.key,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final mapDriverController = Get.find<MapDriverController>();
|
||||
// return Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// Container(
|
||||
// decoration: AppStyle.boxDecoration1.copyWith(
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// color: AppColor.accentColor.withOpacity(0.2),
|
||||
// blurRadius: 8,
|
||||
// offset: Offset(0, 4),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
// child: Text(
|
||||
// mapDriverController.carType,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ),
|
||||
// if (mapDriverController.carType != 'Comfort' &&
|
||||
// mapDriverController.carType != 'Mishwar Vip' &&
|
||||
// mapDriverController.carType != 'Lady')
|
||||
// Container(
|
||||
// width: Get.width * 0.6,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
// gradient: LinearGradient(
|
||||
// colors: [
|
||||
// mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
// ? AppColor.redColor.withOpacity(0.8)
|
||||
// : AppColor.greenColor.withOpacity(0.8),
|
||||
// mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
// ? AppColor.redColor
|
||||
// : AppColor.greenColor,
|
||||
// ],
|
||||
// begin: Alignment.centerLeft,
|
||||
// end: Alignment.centerRight,
|
||||
// ),
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// color: (mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
// ? AppColor.redColor
|
||||
// : AppColor.greenColor)
|
||||
// .withOpacity(0.3),
|
||||
// blurRadius: 8,
|
||||
// offset: Offset(0, 4),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// child: ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
// child: Stack(
|
||||
// children: [
|
||||
// LinearProgressIndicator(
|
||||
// backgroundColor: Colors.white.withOpacity(0.2),
|
||||
// valueColor: AlwaysStoppedAnimation<Color>(
|
||||
// Colors.white.withOpacity(0.5),
|
||||
// ),
|
||||
// minHeight: 40,
|
||||
// value:
|
||||
// mapDriverController.progressTimerRideBegin.toDouble(),
|
||||
// ),
|
||||
// Center(
|
||||
// child: AnimatedDefaultTextStyle(
|
||||
// duration: Duration(milliseconds: 300),
|
||||
// style: AppStyle.title.copyWith(
|
||||
// color: Colors.white,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// fontSize:
|
||||
// mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
// ? 18
|
||||
// : 16,
|
||||
// shadows: [
|
||||
// Shadow(
|
||||
// color: Colors.black26,
|
||||
// offset: Offset(0, 2),
|
||||
// blurRadius: 4,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// child: Text(
|
||||
// mapDriverController.stringRemainingTimeRideBegin,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
// Widget _buildInfoColumn({required IconData icon, required String text}) {
|
||||
// return Column(
|
||||
// children: [
|
||||
// Icon(icon),
|
||||
// Text(
|
||||
// text,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
|
||||
// Widget _buildInfoBox({required IconData icon, required String text}) {
|
||||
// return Container(
|
||||
// width: Get.width * .2,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
// padding: const EdgeInsets.all(4),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Icon(icon),
|
||||
// SizedBox(width: 4),
|
||||
// Text(
|
||||
// text,
|
||||
// style: AppStyle.number,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
// GetBuilder<MapDriverController> speedCircle() {
|
||||
// if (Get.find<MapDriverController>().speed > 100) {
|
||||
// if (Platform.isIOS) {
|
||||
// HapticFeedback.selectionClick();
|
||||
// } else {
|
||||
// Vibration.vibrate(duration: 1000);
|
||||
// }
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible: false,
|
||||
// titleStyle: AppStyle.title,
|
||||
// title: 'Speed Over'.tr,
|
||||
// middleText: 'Please slow down'.tr,
|
||||
// middleTextStyle: AppStyle.title,
|
||||
// confirm: MyElevatedButton(
|
||||
// title: 'I will slow down'.tr,
|
||||
// onPressed: () => Get.back(),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// return GetBuilder<MapDriverController>(
|
||||
// builder: (mapDriverController) {
|
||||
// return mapDriverController.isRideStarted
|
||||
// ? Positioned(
|
||||
// bottom: 25,
|
||||
// right: 100,
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
// color: mapDriverController.speed > 100
|
||||
// ? Colors.red
|
||||
// : AppColor.secondaryColor,
|
||||
// border: Border.all(width: 3, color: AppColor.redColor),
|
||||
// ),
|
||||
// height: 60,
|
||||
// width: 60,
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// mapDriverController.speed.toStringAsFixed(0),
|
||||
// style: AppStyle.number,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox();
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -355,7 +48,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
),
|
||||
_buildInfoColumn(
|
||||
icon: Icons.money_sharp,
|
||||
text: '${controller.paymentAmount} ${'\$'.tr}',
|
||||
text: '${controller.paymentAmount} ${'SYP'.tr}',
|
||||
label: 'Price'.tr,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -194,11 +194,10 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
Marker(
|
||||
markerId: MarkerId('MyLocation'.tr),
|
||||
position: locationController.myLocation,
|
||||
draggable: false, // Changed: لا يمكن سحب ماركر السائق
|
||||
icon: controller.carIcon,
|
||||
rotation: locationController.heading,
|
||||
anchor: const Offset(
|
||||
0.5, 0.5), // New: وضع نقطة ارتكاز الأيقونة في المنتصف
|
||||
flat: true,
|
||||
anchor: const Offset(0.5, 0.5),
|
||||
icon: controller.carIcon,
|
||||
),
|
||||
Marker(
|
||||
markerId: MarkerId('start'.tr),
|
||||
|
||||
Reference in New Issue
Block a user