passnger/5/3/4
This commit is contained in:
@@ -1,223 +0,0 @@
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/firebase/firbase_messge.dart';
|
||||
import '../../controller/payment/payment_controller.dart';
|
||||
import '../../controller/rate/rate_conroller.dart';
|
||||
import '../../main.dart';
|
||||
import '../widgets/elevated_btn.dart';
|
||||
import '../widgets/my_scafold.dart';
|
||||
|
||||
class RateDriverFromPassenger extends StatelessWidget {
|
||||
RateDriverFromPassenger({super.key});
|
||||
final RateController controller = Get.put(RateController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Rate Driver'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: Get.width * .1,
|
||||
right: Get.width * .1,
|
||||
child: Container(
|
||||
// height: Get.height * 6,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
height: Get.height * .5,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'${'Total price to '.tr}${Get.find<MapPassengerController>().firstName}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor.redColor,
|
||||
)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
(double.parse(controller.price
|
||||
.toString()) *
|
||||
.12 +
|
||||
double.parse(controller.price
|
||||
.toString()))
|
||||
.toStringAsFixed(2),
|
||||
style: AppStyle.number.copyWith(
|
||||
color: AppColor.redColor,
|
||||
textBaseline:
|
||||
TextBaseline.ideographic,
|
||||
decoration:
|
||||
TextDecoration.lineThrough,
|
||||
decorationColor:
|
||||
AppColor.redColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor.greenColor,
|
||||
)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
controller.price.toString(),
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Text(
|
||||
'Exclusive offers and discounts always with the Sefer app'
|
||||
.tr,
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
(Get.find<PaymentController>().isCashChecked ==
|
||||
false &&
|
||||
Get.find<PaymentController>()
|
||||
.isWalletChecked ==
|
||||
true)
|
||||
? const DriverTipWidget()
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
Center(
|
||||
child: RatingBar.builder(
|
||||
initialRating: 0,
|
||||
itemCount: 5,
|
||||
itemSize: 50,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2),
|
||||
itemBuilder: (context, index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return const Icon(
|
||||
Icons.sentiment_very_dissatisfied,
|
||||
color: Colors.red,
|
||||
);
|
||||
case 1:
|
||||
return const Icon(
|
||||
Icons.sentiment_dissatisfied,
|
||||
color: Colors.redAccent,
|
||||
);
|
||||
case 2:
|
||||
return const Icon(
|
||||
Icons.sentiment_neutral,
|
||||
color: Colors.amber,
|
||||
);
|
||||
case 3:
|
||||
return const Icon(
|
||||
Icons.sentiment_satisfied,
|
||||
color: Colors.lightGreen,
|
||||
);
|
||||
case 4:
|
||||
return const Icon(
|
||||
Icons.sentiment_very_satisfied,
|
||||
color: Colors.green,
|
||||
);
|
||||
default:
|
||||
return const Icon(
|
||||
Icons.sentiment_neutral,
|
||||
color: Colors.amber,
|
||||
);
|
||||
} //
|
||||
},
|
||||
onRatingUpdate: (rating) {
|
||||
controller.selectRateItem(rating);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .75,
|
||||
child: TextFormField(
|
||||
maxLines: 4,
|
||||
minLines: 1,
|
||||
keyboardType: TextInputType.multiline,
|
||||
controller: controller.comment,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Enter your Note'.tr,
|
||||
hintText: 'Type something...'.tr,
|
||||
prefixIcon: const Icon(
|
||||
Icons.rate_review), // Add an icon as a prefix
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.redColor,
|
||||
), // Add an icon as a suffix
|
||||
onPressed: () {
|
||||
controller.comment.clear();
|
||||
},
|
||||
),
|
||||
border:
|
||||
const OutlineInputBorder(), // Add a border around the input field
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
Colors.blue), // Customize the border color
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors
|
||||
.green), // Customize the border color when focused
|
||||
),
|
||||
errorBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors
|
||||
.red), // Customize the border color when there's an error
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Submit rating'.tr,
|
||||
onPressed: () => controller.addRateToDriver())
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
isleading: false);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -25,18 +24,32 @@ class AiPage extends StatelessWidget {
|
||||
return MyScafolld(
|
||||
title: 'Documents check'.tr,
|
||||
body: [
|
||||
// box.read(BoxName.countryCode) == 'USA'
|
||||
// ? UsaAiDocuments(scanDocumentsByApi: scanDocumentsByApi)
|
||||
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||
// ? JordanDocumants(contentController: contentController)
|
||||
// :
|
||||
// EgyptDocuments(contentController: contentController),
|
||||
// box.read(BoxName.countryCode) == 'USA'
|
||||
// ? usaDriverLicensWidget()
|
||||
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||
// ? jordanDriverLicenseWidget()
|
||||
// :
|
||||
egyptDriverLicenseWidget()
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: Get.height * .3,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Center(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await CRUD().allMethodForAI(
|
||||
'name,address,dob,nationalNo,',
|
||||
AppLink.uploadEgypt,
|
||||
'idFront'); //egypt
|
||||
},
|
||||
child: Text(
|
||||
'Take Picture Of ID Card'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
@@ -44,260 +57,251 @@ class AiPage extends StatelessWidget {
|
||||
GetBuilder<AI> egyptDriverLicenseWidget() {
|
||||
return GetBuilder<AI>(
|
||||
builder: (contentController) => contentController.responseMap.isNotEmpty
|
||||
? Positioned(
|
||||
top: Get.height * .09,
|
||||
left: Get.width * .051,
|
||||
right: Get.width * .051,
|
||||
child: contentController.isloading
|
||||
? Column(
|
||||
children: [
|
||||
const MyCircularProgressIndicator(),
|
||||
Text(
|
||||
'We are process picture please wait '.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
? contentController.isloading
|
||||
? Column(
|
||||
children: [
|
||||
const MyCircularProgressIndicator(),
|
||||
Text(
|
||||
'We are process picture please wait '.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
: SizedBox(
|
||||
height: Get.height * .7,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
// height: Get.height * .4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: contentController.responseMap.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
'Take Picture Of ID Card'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
],
|
||||
)
|
||||
: SizedBox(
|
||||
height: Get.height * .7,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
// height: Get.height * .4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: contentController.responseMap.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
'Take Picture Of ID Card'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${'Name'.tr} :${contentController.responseMap['first_name']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
' ${contentController.responseMap['last_name']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
Text(
|
||||
'${'Name'.tr} :${contentController.responseMap['first_name']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'${'Name in arabic'.tr}: ${contentController.responseMap['name_in_arabic']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Drivers License Class'.tr}: ${contentController.responseMap['class']}',
|
||||
style: AppStyle.title,
|
||||
' ${contentController.responseMap['last_name']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'National Number'.tr}: ${contentController.responseMap['id']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// Image.memory(
|
||||
// scanDocumentsByApi
|
||||
// .imagePortrait,
|
||||
// width: 60,
|
||||
// ),
|
||||
]),
|
||||
Text(
|
||||
'${'Address'.tr}: ${contentController.responseMap['address']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Date of Birth'.tr}: ${contentController.responseMap['dob']}',
|
||||
'${'Name in arabic'.tr}: ${contentController.responseMap['name_in_arabic']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Age'.tr} : ${contentController.responseMap['age_in_years']}',
|
||||
'${'Drivers License Class'.tr}: ${contentController.responseMap['class']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Expiry Date'.tr}: ${contentController.responseMap['expiration_date']}',
|
||||
style: DateTime.parse(
|
||||
contentController
|
||||
.responseMap[
|
||||
'expiration_date']
|
||||
.toString())
|
||||
.isBefore(
|
||||
contentController.now)
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color:
|
||||
AppColor.greenColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
DateTime.parse(contentController
|
||||
.responseMap['expiration_date']
|
||||
.toString())
|
||||
.isBefore(contentController.now)
|
||||
? Text(
|
||||
'You can\'t continue with us .\nYou should renew Driver license'
|
||||
.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.redColor),
|
||||
)
|
||||
: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Lets check Car license '.tr,
|
||||
onPressed: () => contentController
|
||||
.getCarLicenseJordanContent()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
contentController.responseCarLicenseMap.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// height: Get.height * .3,
|
||||
width: Get.width * .9,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'${'Name'.tr} ${contentController.responseCarLicenseMap['name']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Address'.tr} ${contentController.responseCarLicenseMap['address']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Kind'.tr} ${contentController.responseCarLicenseMap['car_kind']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Color'.tr} ${contentController.responseCarLicenseMap['car_color']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Year'.tr} ${contentController.responseCarLicenseMap['car_year']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Plate'.tr} ${contentController.responseCarLicenseMap['car_plate']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Expire'.tr} ${contentController.responseCarLicenseMap['expire_date_of_license']}',
|
||||
style: contentController
|
||||
.responseCarLicenseMap
|
||||
.isNotEmpty
|
||||
? DateTime.parse(contentController
|
||||
.responseCarLicenseMap[
|
||||
'expire_date_of_license']
|
||||
.toString())
|
||||
.isBefore(
|
||||
contentController.now)
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// DateTime.parse(contentController
|
||||
// .responseCarLicenseMap[
|
||||
// 'expire_date_of_license']
|
||||
// .toString())
|
||||
// .isBefore(contentController.now)
|
||||
// ? Text(
|
||||
// 'You can\'t continue with us .\nYou should renew Car license'
|
||||
// .tr,
|
||||
// style: AppStyle.title.copyWith(
|
||||
// color: AppColor.redColor),
|
||||
// )
|
||||
// :
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Lets check License Back Face'.tr,
|
||||
onPressed: () => contentController
|
||||
.generateBackCarLicenseJordanContent()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
contentController.responseBackCarLicenseMap.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// height: 300,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'National Number'.tr}: ${contentController.responseMap['id']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// Image.memory(
|
||||
// scanDocumentsByApi
|
||||
// .imagePortrait,
|
||||
// width: 60,
|
||||
// ),
|
||||
]),
|
||||
Text(
|
||||
'VIN ${contentController.responseBackCarLicenseMap['vin']}',
|
||||
'${'Address'.tr}: ${contentController.responseMap['address']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Fuel Type ${contentController.responseBackCarLicenseMap['fuelType']}',
|
||||
style: AppStyle.title,
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Date of Birth'.tr}: ${contentController.responseMap['dob']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Age'.tr} : ${contentController.responseMap['age_in_years']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Insurance Company ${contentController.responseBackCarLicenseMap['insuranceCompany']}',
|
||||
style: AppStyle.title,
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Expiry Date'.tr}: ${contentController.responseMap['expiration_date']}',
|
||||
style: DateTime.parse(
|
||||
contentController
|
||||
.responseMap[
|
||||
'expiration_date']
|
||||
.toString())
|
||||
.isBefore(
|
||||
contentController.now)
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Policy Number ${contentController.responseBackCarLicenseMap['policyNumber']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Insurance Type ${contentController.responseBackCarLicenseMap['insuranceType']}',
|
||||
style: AppStyle.title,
|
||||
)
|
||||
]))
|
||||
: const SizedBox()
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
DateTime.parse(contentController
|
||||
.responseMap['expiration_date']
|
||||
.toString())
|
||||
.isBefore(contentController.now)
|
||||
? Text(
|
||||
'You can\'t continue with us .\nYou should renew Driver license'
|
||||
.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.redColor),
|
||||
)
|
||||
: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Lets check Car license '.tr,
|
||||
onPressed: () => contentController
|
||||
.getCarLicenseJordanContent()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
contentController.responseCarLicenseMap.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// height: Get.height * .3,
|
||||
width: Get.width * .9,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'${'Name'.tr} ${contentController.responseCarLicenseMap['name']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Address'.tr} ${contentController.responseCarLicenseMap['address']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Kind'.tr} ${contentController.responseCarLicenseMap['car_kind']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Color'.tr} ${contentController.responseCarLicenseMap['car_color']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Year'.tr} ${contentController.responseCarLicenseMap['car_year']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Plate'.tr} ${contentController.responseCarLicenseMap['car_plate']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Car Expire'.tr} ${contentController.responseCarLicenseMap['expire_date_of_license']}',
|
||||
style: contentController
|
||||
.responseCarLicenseMap.isNotEmpty
|
||||
? DateTime.parse(contentController
|
||||
.responseCarLicenseMap[
|
||||
'expire_date_of_license']
|
||||
.toString())
|
||||
.isBefore(contentController.now)
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// DateTime.parse(contentController
|
||||
// .responseCarLicenseMap[
|
||||
// 'expire_date_of_license']
|
||||
// .toString())
|
||||
// .isBefore(contentController.now)
|
||||
// ? Text(
|
||||
// 'You can\'t continue with us .\nYou should renew Car license'
|
||||
// .tr,
|
||||
// style: AppStyle.title.copyWith(
|
||||
// color: AppColor.redColor),
|
||||
// )
|
||||
// :
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Lets check License Back Face'.tr,
|
||||
onPressed: () => contentController
|
||||
.generateBackCarLicenseJordanContent()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
contentController.responseBackCarLicenseMap.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// height: 300,
|
||||
child: Column(children: [
|
||||
Text(
|
||||
'VIN ${contentController.responseBackCarLicenseMap['vin']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Fuel Type ${contentController.responseBackCarLicenseMap['fuelType']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Insurance Company ${contentController.responseBackCarLicenseMap['insuranceCompany']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Policy Number ${contentController.responseBackCarLicenseMap['policyNumber']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Insurance Type ${contentController.responseBackCarLicenseMap['insuranceType']}',
|
||||
style: AppStyle.title,
|
||||
)
|
||||
]))
|
||||
: const SizedBox()
|
||||
],
|
||||
),
|
||||
)
|
||||
: Positioned(
|
||||
top: Get.height * .06,
|
||||
left: Get.width * .051,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:SEFER/constant/api_key.dart';
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -6,9 +5,7 @@ import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/char_map.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/credential.dart';
|
||||
import '../../../constant/info.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/auth/captin/login_captin_controller.dart';
|
||||
@@ -21,7 +18,7 @@ import '../../widgets/mycircular.dart';
|
||||
import 'register_captin.dart';
|
||||
|
||||
class LoginCaptin extends StatelessWidget {
|
||||
final controller = Get.put(LoginController());
|
||||
// final controller = Get.put(LoginController());
|
||||
|
||||
LoginCaptin({super.key});
|
||||
|
||||
@@ -32,7 +29,7 @@ class LoginCaptin extends StatelessWidget {
|
||||
return GetBuilder<LoginCaptinController>(
|
||||
builder: (controller) => MyScafolld(
|
||||
title: 'Login Driver'.tr,
|
||||
isleading: true,
|
||||
isleading: false,
|
||||
body: [
|
||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||
agreedPage()
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/controller/functions/call_controller.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
|
||||
class CallPageFromPassenger extends StatelessWidget {
|
||||
const CallPageFromPassenger({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Call Page'.tr, isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
// callController.initAgoraFull();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// await callController.initAgoraFull();
|
||||
// callController.join();
|
||||
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
// 'Call Income',
|
||||
// 'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
// Get.find<MapDriverController>().tokenPassenger,
|
||||
// [
|
||||
// callController.token,
|
||||
// callController.channelName,
|
||||
// callController.uid.toString(),
|
||||
// callController.remoteUid.toString(),
|
||||
// ],
|
||||
// );
|
||||
callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapPassengerController>()
|
||||
.driverName
|
||||
.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Call End',
|
||||
'Call End'.tr,
|
||||
Get.find<MapPassengerController>().driverToken,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
import 'package:SEFER/controller/functions/tts.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/lang/languages.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:share/share.dart';
|
||||
|
||||
import '../../controller/functions/audio_record1.dart';
|
||||
import 'profile/passenger_profile_page.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
isleading: true,
|
||||
title: 'Home Page'.tr,
|
||||
body: [
|
||||
Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const Language());
|
||||
},
|
||||
title: Text(
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('To change Language the App'.tr),
|
||||
trailing: const Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 30,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
leading: const Icon(
|
||||
Icons.language_sharp,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.location_city_outlined),
|
||||
title: Text(
|
||||
'Change Country'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle:
|
||||
Text('You can change the Country to get all features'.tr),
|
||||
onTap: () => Get.to(MyScafolld(
|
||||
title: 'Change Country'.tr,
|
||||
body: [CountryPickerFromSetting()],
|
||||
isleading: true)),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.record_voice_over_outlined),
|
||||
title: Text(
|
||||
'Trips recorded'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('Here recorded trips audio'.tr),
|
||||
onTap: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Select recorded trip'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content:
|
||||
GetBuilder<AudioRecorderController>(builder: (audio) {
|
||||
return Column(
|
||||
children: [
|
||||
FutureBuilder<List<String>>(
|
||||
future: audio.getRecordedFiles(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const CircularProgressIndicator();
|
||||
} else if (snapshot.hasData) {
|
||||
final recordedFiles = snapshot.data!;
|
||||
return DropdownButton<String>(
|
||||
value: audio.selectedFilePath,
|
||||
onChanged: (value) {
|
||||
audio.selectedFilePath = value;
|
||||
audio.playRecordedFile(value!);
|
||||
audio.update();
|
||||
},
|
||||
items: recordedFiles
|
||||
.map((file) => DropdownMenuItem<String>(
|
||||
value: file,
|
||||
child: Text(path.basename(file)),
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
} else {
|
||||
return Text('Error: ${snapshot.error}');
|
||||
}
|
||||
},
|
||||
),
|
||||
Slider(
|
||||
value: audio.currentPosition,
|
||||
max: audio.totalDuration,
|
||||
inactiveColor: AppColor.accentColor,
|
||||
label: audio.currentPosition.toString(),
|
||||
onChanged: (value) {
|
||||
audio.currentPosition = value;
|
||||
// audio.update();
|
||||
audio.audioPlayer
|
||||
.seek(Duration(seconds: value.toInt()));
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
color: Colors.grey[200],
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
audio.selectedFilePath != null
|
||||
? '${'Selected file:'.tr} ${path.basename(audio.selectedFilePath!)}'
|
||||
: 'No file selected'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
if (audio.selectedFilePath != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: () {
|
||||
Share.shareFiles(
|
||||
[audio.selectedFilePath!]);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you sure to delete recorded files'
|
||||
.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
'this will delete all files from your device'
|
||||
.tr);
|
||||
},
|
||||
icon: const Icon(Icons.headphones),
|
||||
),
|
||||
Text(
|
||||
'this will delete all files from your device'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Delete'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () async {
|
||||
await audio
|
||||
// .deleteRecordedFile(audio.selectedFilePath!);
|
||||
.deleteAllRecordedFiles();
|
||||
Get.back();
|
||||
Get.back();
|
||||
}));
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../controller/home/map_passenger_controller.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/home/map_widget.dart/cancel_raide_page.dart';
|
||||
import '../../views/home/map_widget.dart/ride_begin_passenger.dart';
|
||||
|
||||
import '../../controller/home/menu_controller.dart';
|
||||
import 'map_widget.dart/apply_order_widget.dart';
|
||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||
import 'map_widget.dart/car_details_widget_to_go.dart';
|
||||
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
||||
import 'map_widget.dart/google_map_passenger_widget.dart';
|
||||
import 'map_widget.dart/left_main_menu_icons.dart';
|
||||
import 'map_widget.dart/main_bottom_menu_map.dart';
|
||||
import 'map_widget.dart/map_menu_widget.dart';
|
||||
import 'map_widget.dart/menu_map_page.dart';
|
||||
import 'map_widget.dart/passengerRideLoctionWidget.dart';
|
||||
import 'map_widget.dart/payment_method.page.dart';
|
||||
import 'map_widget.dart/points_page_for_rider.dart';
|
||||
import 'map_widget.dart/ride_from_start_app.dart';
|
||||
import 'map_widget.dart/searching_captain_window.dart';
|
||||
|
||||
class MapPagePassenger extends StatelessWidget {
|
||||
const MapPagePassenger({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
Get.put(MyMenuController());
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Stack(
|
||||
children: [
|
||||
GoogleMapPassengerWidget(),
|
||||
leftMainMenuIcons(),
|
||||
// PaymobPackage(),
|
||||
const PickerIconOnMap(),
|
||||
// PickerAnimtionContainerFormPlaces(),
|
||||
const MainBottomMenuMap(),
|
||||
// NewMainBottomSheet(),
|
||||
const MapMenuWidget(),
|
||||
const MenuIconMapPageWidget(),
|
||||
buttomSheetMapPage(),
|
||||
CarDetailsTypeToChoose(),
|
||||
const Burc(),
|
||||
const ApplyOrderWidget(),
|
||||
// hexagonClipper(),
|
||||
const CancelRidePageShow(),
|
||||
CashConfirmPageShown(),
|
||||
const PaymentMethodPage(),
|
||||
const SearchingCaptainWindow(),
|
||||
// timerForCancelTripFromPassenger(),
|
||||
// const DriverTimeArrivePassengerPage(),
|
||||
// const TimerToPassengerFromDriver(),
|
||||
PassengerRideLocationWidget(),
|
||||
const RideBeginPassenger(),
|
||||
const RideFromStartApp(),
|
||||
cancelRidePage(),
|
||||
PointsPageForRider()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CancelRidePageShow extends StatelessWidget {
|
||||
const CancelRidePageShow({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) =>
|
||||
(controller.data.isNotEmpty && controller.remainingTime > 0)
|
||||
// ||
|
||||
// controller.timeToPassengerFromDriverAfterApplied == 0
|
||||
? Positioned(
|
||||
right: box.read(BoxName.lang) != 'ar' ? 10 : null,
|
||||
left: box.read(BoxName.lang) == 'ar' ? 10 : null,
|
||||
top: 30,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.changeCancelRidePageShow();
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.redColor,
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(3),
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
size: 40,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
: const SizedBox());
|
||||
}
|
||||
}
|
||||
|
||||
class PickerIconOnMap extends StatelessWidget {
|
||||
const PickerIconOnMap({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isPickerShown
|
||||
? Positioned(
|
||||
bottom: Get.height * .2,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: controller.isPickerShown
|
||||
? const Icon(
|
||||
Icons.add_location,
|
||||
color: Colors.purple,
|
||||
)
|
||||
: const SizedBox(),
|
||||
)
|
||||
: const SizedBox());
|
||||
}
|
||||
}
|
||||
@@ -1,415 +0,0 @@
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/widget/call_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
|
||||
class ApplyOrderWidget extends StatelessWidget {
|
||||
const ApplyOrderWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Apply' &&
|
||||
controller.isSearchingWindow == false) {
|
||||
// double _height = Get.height * .2;
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .35,
|
||||
child: ListView(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (box.read(BoxName.carType) == 'Speed' ||
|
||||
box.read(BoxName.carType) == 'Delivery') {
|
||||
Get.snackbar(
|
||||
'This price is ${controller.totalPassenger.toStringAsFixed(2)}'
|
||||
.tr,
|
||||
'This ride type does not allow changes to the destination or additional stops'
|
||||
.tr,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
duration: const Duration(seconds: 2),
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'This price may be changed'.tr,
|
||||
'This ride type allows changes, but the price may increase'
|
||||
.tr,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
duration: const Duration(seconds: 2),
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '${'The driver accept your order for'.tr} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
TextSpan(
|
||||
text: controller.totalPassenger.toStringAsFixed(2),
|
||||
style: AppStyle.title.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
// fontSize: 22,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${'LE'.tr}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
height: Get.height * .3,
|
||||
width: Get.width * .9,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
// 'Comfort',
|
||||
box.read(BoxName.carType
|
||||
.toString()), //car type fro box after selected
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/blob.png',
|
||||
width: 100,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
// 'Toyota Camry',
|
||||
controller.model.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
// 'ر ل 2323',
|
||||
controller.licensePlate.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
// 'Black',
|
||||
controller.carColor,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundImage: NetworkImage(
|
||||
// '',
|
||||
// ),
|
||||
'https://ride.mobile-app.store/portrate_captain_image/${controller.driverId}.jpg'),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
// 'fadi ahmad',
|
||||
controller.firstName,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
// '⭐ 4.8',
|
||||
'⭐ ${controller.driverRate}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'Select one message'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Container(
|
||||
height: Get.height * .5,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'Hello, I\'m at the agreed-upon location'
|
||||
.tr,
|
||||
controller
|
||||
.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
10),
|
||||
child: Text(
|
||||
'Hello, I\'m at the agreed-upon location'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'My location is correct. You can search for me using the navigation app'
|
||||
.tr,
|
||||
controller
|
||||
.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
10),
|
||||
child: Text(
|
||||
'My location is correct. You can search for me using the navigation app'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'message From passenger',
|
||||
'I\'m waiting for you'
|
||||
.tr,
|
||||
controller
|
||||
.driverToken);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
10),
|
||||
child: Text(
|
||||
'I\'m waiting for you'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.message,
|
||||
color: AppColor.blueColor,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
HapticFeedback.heavyImpact();
|
||||
Get.to(() => const CallPage());
|
||||
// Get.to(() => PassengerCallPage());
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
color: AppColor.greenColor,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
controller.isDriverArrivePassenger
|
||||
? const DriverArrivePassengerAndWaitMinute()
|
||||
: const TimeDriverToPassenger()
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class DriverArrivePassengerAndWaitMinute extends StatelessWidget {
|
||||
const DriverArrivePassengerAndWaitMinute({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
return Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color: controller.remainingTimeDriverWaitPassenger5Minute < 60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value:
|
||||
controller.progressTimerDriverWaitPassenger5Minute.toDouble(),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'The driver waiting you in picked location .'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
controller.stringRemainingTimeDriverWaitPassenger5Minute,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class TimeDriverToPassenger extends StatelessWidget {
|
||||
const TimeDriverToPassenger({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
return controller.isDriverInPassengerWay == false ||
|
||||
controller.timeToPassengerFromDriverAfterApplied > 0
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: Get.width * .7,
|
||||
height: 35,
|
||||
// color: AppColor.yellowColor,
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color: controller
|
||||
.remainingTimeToPassengerFromDriverAfterApplied <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: () {
|
||||
// Ensure valid value between 0.0 and 1.0
|
||||
double progress = controller
|
||||
.progressTimerToPassengerFromDriverAfterApplied
|
||||
.toDouble();
|
||||
if (progress.isNaN || progress.isInfinite) {
|
||||
// Handle invalid progress (e.g., set to 0.0)
|
||||
return 0.0;
|
||||
} else {
|
||||
return progress.clamp(
|
||||
0.0, 1.0); // Clamp to valid range
|
||||
}
|
||||
}(),
|
||||
),
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'The driver on your way'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
controller.stringRemainingTimeToPassenger,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,565 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/info.dart';
|
||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isBottomSheetShown &&
|
||||
controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
right: 5,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||
0 &&
|
||||
controller.data.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: AppColor.redColor.withOpacity(.5)),
|
||||
height: 50,
|
||||
width: Get.width * .94,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(
|
||||
'Your trip cost is'.tr +
|
||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
'But you have a negative salary of'
|
||||
.tr +
|
||||
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||
' in your'
|
||||
.tr +
|
||||
' ${AppInformation.appName}'
|
||||
' wallet due to a previous trip.'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
))
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
curve: Curves.easeInCirc,
|
||||
onEnd: () {
|
||||
controller.height = 250;
|
||||
},
|
||||
height: controller.heightBottomSheetShown,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: controller
|
||||
.dataCarsLocationByPassenger.length -
|
||||
1,
|
||||
itemBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return Container(
|
||||
color: controller.gender == 'Female'
|
||||
? const Color.fromARGB(
|
||||
255, 246, 52, 181)
|
||||
: AppColor.secondaryColor,
|
||||
width: Get.width,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .55,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.hours > 0
|
||||
? '${'Your Ride Duration is '.tr}${controller.hours} ${'H and'.tr} ${controller.minutes} ${'m'.tr}'
|
||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
// Text(
|
||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
Text(
|
||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} ${'KM'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5, left: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .14,
|
||||
height: Get.height * .06,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
shape:
|
||||
BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor
|
||||
.greenColor)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style:
|
||||
AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.promoTaken
|
||||
? const Icon(
|
||||
Icons
|
||||
.filter_vintage_rounded,
|
||||
color:
|
||||
AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
// height: 130,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_on,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'From : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['start_address']
|
||||
.toString(),
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons
|
||||
.location_searching_rounded),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'To : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
AppColor.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
// border: Border.all(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color: Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
Get.find<
|
||||
PaymentController>()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder: (paymentController) =>
|
||||
paymentController
|
||||
.isCashChecked
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.qr_code_2_rounded,
|
||||
color: Colors
|
||||
.green[
|
||||
400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (controller
|
||||
.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
labelStyle: AppStyle.subtitle,
|
||||
hintStyle: AppStyle.subtitle,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Add Promo'.tr,
|
||||
onPressed: () async {
|
||||
controller.applyPromoCodeToPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'
|
||||
.tr,
|
||||
'',
|
||||
backgroundColor:
|
||||
AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Add Promo'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.isCashSelectedBeforeConfirmRide ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
)
|
||||
:
|
||||
// controller.isPassengerChosen ==
|
||||
// false
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// controller
|
||||
// .onChangedPassengersChoose();
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible:
|
||||
// false,
|
||||
// title:
|
||||
// 'How Many Passengers?'
|
||||
// .tr,
|
||||
// titleStyle:
|
||||
// AppStyle
|
||||
// .title,
|
||||
// content:
|
||||
// Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Allowed up to 4 Passengers.'
|
||||
// .tr,
|
||||
// style: AppStyle
|
||||
// .title,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height:
|
||||
// 200, // Set the desired height here
|
||||
// child:
|
||||
// CupertinoPicker(
|
||||
// itemExtent:
|
||||
// 32,
|
||||
// onSelectedItemChanged:
|
||||
// (index) {
|
||||
// controller.onChangedPassengerCount(index +
|
||||
// 1);
|
||||
// },
|
||||
// children: [
|
||||
// Text('1 Passenger'.tr),
|
||||
// Text('2 Passengers'.tr),
|
||||
// Text('3 Passengers'.tr),
|
||||
// Text('4 Passengers'.tr),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// MyElevatedButton(
|
||||
// title:
|
||||
// 'Back',
|
||||
// onPressed:
|
||||
// () =>
|
||||
// Get.back(),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// )
|
||||
// :
|
||||
MyElevatedButton(
|
||||
title: 'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.confirmRideForFirstDriver();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
}
|
||||
|
||||
class Details extends StatelessWidget {
|
||||
const Details({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'${'Distance is'.tr} ${controller.data[0]['distance']['text']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Duration is'.tr} ${controller.data[0]['duration']['text']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Cost for .21/km ${controller.costDistance.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Cost Duration'.tr} ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Total Driver ${controller.totalDriver.toStringAsFixed(2)}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'totaME ${controller.totalME.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Cost for passenger ${controller.totalPassenger.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
|
||||
import '../../../../constant/api_key.dart';
|
||||
|
||||
String appId = AK.agoraAppId;
|
||||
|
||||
class PassengerCallPage extends StatefulWidget {
|
||||
const PassengerCallPage({
|
||||
super.key,
|
||||
required this.channelName,
|
||||
required this.token,
|
||||
required this.remoteID,
|
||||
});
|
||||
final String channelName, token, remoteID;
|
||||
@override
|
||||
State<PassengerCallPage> createState() => _PassengerCallPageState();
|
||||
}
|
||||
|
||||
class _PassengerCallPageState extends State<PassengerCallPage> {
|
||||
int uid = 0;
|
||||
int? _remoteUid = 0; // uid of the remote user
|
||||
bool _isJoined = false; // Indicates if the local user has joined the channel
|
||||
late RtcEngine agoraEngine; // Agora engine instance
|
||||
|
||||
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
|
||||
GlobalKey<ScaffoldMessengerState>(); // Global key to access the scaffold
|
||||
|
||||
showMessage(String message) {
|
||||
scaffoldMessengerKey.currentState?.showSnackBar(SnackBar(
|
||||
content: Text(message),
|
||||
));
|
||||
}
|
||||
|
||||
initAgora() async {
|
||||
await setupVoiceSDKEngine();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_remoteUid = int.parse(widget.remoteID);
|
||||
uid = int.parse(box.read(BoxName.phone));
|
||||
print('remoteid is ${widget.remoteID}');
|
||||
print('token is ${widget.token}');
|
||||
print('channelName is ${widget.channelName}');
|
||||
// Set up an instance of Agora engine
|
||||
initAgora();
|
||||
}
|
||||
|
||||
Future<void> setupVoiceSDKEngine() async {
|
||||
// retrieve or request microphone permission
|
||||
await [Permission.microphone].request();
|
||||
|
||||
//create an instance of the Agora engine
|
||||
agoraEngine = createAgoraRtcEngine();
|
||||
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
|
||||
print('eeeeeeeeeeeeeeeeeeee');
|
||||
print(agoraEngine);
|
||||
// Register the event handler
|
||||
agoraEngine.registerEventHandler(
|
||||
RtcEngineEventHandler(
|
||||
onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
|
||||
showMessage(
|
||||
"Local user uid:${connection.localUid} joined the channel");
|
||||
setState(() {
|
||||
_isJoined = true;
|
||||
});
|
||||
},
|
||||
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
|
||||
showMessage("Remote user uid:$remoteUid joined the channel");
|
||||
setState(() {
|
||||
_remoteUid = remoteUid;
|
||||
});
|
||||
},
|
||||
onUserOffline: (RtcConnection connection, int? remoteUid,
|
||||
UserOfflineReasonType reason) {
|
||||
showMessage("Remote user uid:$remoteUid left the channel");
|
||||
setState(() {
|
||||
_remoteUid = null;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void join() async {
|
||||
// Set channel options including the client role and channel profile
|
||||
ChannelMediaOptions options = const ChannelMediaOptions(
|
||||
clientRoleType: ClientRoleType.clientRoleBroadcaster,
|
||||
channelProfile: ChannelProfileType.channelProfileCommunication,
|
||||
);
|
||||
|
||||
await agoraEngine.joinChannel(
|
||||
token: widget.token,
|
||||
channelId: widget.channelName,
|
||||
options: options,
|
||||
uid: uid,
|
||||
);
|
||||
}
|
||||
//https://console.agora.io/invite?sign=5e9e22d06f22caeeada9954c9e908572%253A5ba8aed978a35eab5a5113742502ded2a41478b2a81cb19c71a30776e125b58a
|
||||
|
||||
void leave() {
|
||||
setState(() {
|
||||
_isJoined = false;
|
||||
_remoteUid = null;
|
||||
});
|
||||
agoraEngine.leaveChannel();
|
||||
}
|
||||
|
||||
// Clean up the resources when you leave
|
||||
@override
|
||||
void dispose() async {
|
||||
await agoraEngine.leaveChannel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// Build UI
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||
home: MyScafolld(
|
||||
// appBar: AppBar(
|
||||
// title: const Text('Get started with Voice Calling'),
|
||||
// ),
|
||||
title: 'Voice Calling'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
children: [
|
||||
// Status text
|
||||
Container(height: 40, child: Center(child: _status())),
|
||||
// Button Row
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: Text("Join".tr),
|
||||
onPressed: () => {join()},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: Text("Leave".tr),
|
||||
onPressed: () => {leave()},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _status() {
|
||||
String statusText;
|
||||
|
||||
if (!_isJoined) {
|
||||
statusText = 'Join a channel';
|
||||
} else if (_remoteUid == null)
|
||||
statusText = 'Waiting for a remote user to join...';
|
||||
else
|
||||
statusText = 'Connected to remote user, uid:$_remoteUid';
|
||||
|
||||
return Text(
|
||||
statusText,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> cancelRidePage() {
|
||||
Get.put(MapPassengerController());
|
||||
final List<String> reasons = [
|
||||
"I don't need a ride anymore".tr,
|
||||
"I was just trying the application".tr,
|
||||
"No driver accepted my request".tr,
|
||||
"I added the wrong pick-up/drop-off location".tr,
|
||||
"I don't have a reason".tr,
|
||||
"Other".tr,
|
||||
];
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isCancelRidePageShown
|
||||
? Positioned(
|
||||
left: Get.width * .1,
|
||||
top: Get.width * .2,
|
||||
right: Get.width * .1,
|
||||
bottom: Get.width * .15,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2),
|
||||
blurRadius: 5),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2),
|
||||
blurRadius: 5)
|
||||
],
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
height: Get.height * .7,
|
||||
width: Get.width * .7,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Text(
|
||||
'Can we know why you want to cancel Ride ?'.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 380,
|
||||
width: 300,
|
||||
child: ListView.builder(
|
||||
itemCount: reasons.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: InkWell(
|
||||
onTap: () {
|
||||
controller.selectReason(
|
||||
index,
|
||||
reasons[index].toString(),
|
||||
);
|
||||
},
|
||||
child: Text(reasons[index])),
|
||||
leading: Radio(
|
||||
value: index,
|
||||
groupValue: controller.selectedReason,
|
||||
onChanged: (int? value) {
|
||||
// print(value);
|
||||
// print(reasons[index]);
|
||||
controller.selectReason(
|
||||
value!,
|
||||
reasons[index].toString(),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Cancel Ride'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedReason == -1) {
|
||||
Get.snackbar('You Should be select reason.'.tr, '',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: AppColor.redColor);
|
||||
} else {
|
||||
controller.cancelRide();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
);
|
||||
}
|
||||
@@ -1,509 +0,0 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/info.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class CarType {
|
||||
final String carType;
|
||||
final String carDetail;
|
||||
final String image;
|
||||
bool isSelected = false; // Track selection state
|
||||
|
||||
CarType(
|
||||
{required this.carType, required this.carDetail, required this.image});
|
||||
}
|
||||
|
||||
List<CarType> carTypes = [
|
||||
CarType(
|
||||
carType: 'Comfort',
|
||||
carDetail: 'Comfort choice'.tr,
|
||||
image: 'assets/images/blob.png'),
|
||||
CarType(
|
||||
carType: 'Speed',
|
||||
carDetail: 'Closest & Cheapest'.tr,
|
||||
image: 'assets/images/carspeed.png'),
|
||||
CarType(
|
||||
carType: 'Delivery',
|
||||
carDetail: 'Delivery service'.tr,
|
||||
image: 'assets/images/moto.png'),
|
||||
CarType(
|
||||
carType: 'Mashwari',
|
||||
carDetail: 'Mashwari without end point'.tr,
|
||||
image: 'assets/images/freeRide.png'),
|
||||
];
|
||||
|
||||
class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
CarDetailsTypeToChoose({super.key});
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (mapPassengerController) {
|
||||
return mapPassengerController.data.isNotEmpty &&
|
||||
mapPassengerController.isBottomSheetShown &&
|
||||
mapPassengerController.rideConfirm == false
|
||||
? Positioned(
|
||||
bottom: 0,
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromARGB(255, 255, 255, 255),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
height: Get.height * .4,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .4,
|
||||
child: ListView.builder(
|
||||
itemCount: carTypes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final carType = carTypes[index];
|
||||
return ListTile(
|
||||
title: Container(
|
||||
width: Get.width,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(20)),
|
||||
boxShadow: [
|
||||
carType.isSelected
|
||||
? const BoxShadow(
|
||||
spreadRadius: 3,
|
||||
blurStyle: BlurStyle.solid,
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3,
|
||||
offset: Offset(1, 3))
|
||||
: const BoxShadow(),
|
||||
]),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
carType.image,
|
||||
width: 50,
|
||||
height: 50,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
carType.carType,
|
||||
style: AppStyle.title.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
Text(
|
||||
carType.carDetail,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
carType.carType == 'Comfort'
|
||||
? mapPassengerController
|
||||
.totalPassengerComfort
|
||||
.toStringAsFixed(2)
|
||||
: carType.carType == 'Speed'
|
||||
? mapPassengerController
|
||||
.totalPassengerSpeed
|
||||
.toStringAsFixed(2)
|
||||
: carType.carType == 'Delivery'
|
||||
? mapPassengerController
|
||||
.totalPassengerMotoDelivery
|
||||
.toStringAsFixed(2)
|
||||
: '50',
|
||||
style: AppStyle.title
|
||||
.copyWith(fontSize: 20),
|
||||
),
|
||||
carType.carType == 'Comfort' &&
|
||||
(mapPassengerController
|
||||
.totalPassengerSpeed >
|
||||
20)
|
||||
? Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
'-12%',
|
||||
style: AppStyle.subtitle
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.greenColor),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
mapPassengerController
|
||||
.totalPassengerComfortDiscount
|
||||
.toStringAsFixed(2),
|
||||
style:
|
||||
AppStyle.title.copyWith(
|
||||
color: AppColor.redColor,
|
||||
decoration: TextDecoration
|
||||
.lineThrough, // Strikethrough line
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: carType.carType == 'Speed' &&
|
||||
(mapPassengerController
|
||||
.totalPassengerSpeed >
|
||||
20)
|
||||
? Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle
|
||||
.boxDecoration1,
|
||||
child: Text(
|
||||
'-10%',
|
||||
style: AppStyle
|
||||
.subtitle
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.greenColor),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
mapPassengerController
|
||||
.totalPassengerSpeedDiscount
|
||||
.toStringAsFixed(2),
|
||||
style: AppStyle.title
|
||||
.copyWith(
|
||||
color:
|
||||
AppColor.redColor,
|
||||
decoration: TextDecoration
|
||||
.lineThrough, // Strikethrough line
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
selected: mapPassengerController.selectedIndex ==
|
||||
index, // Set selected based on index
|
||||
selectedColor:
|
||||
Colors.blue, // Color for selected item
|
||||
|
||||
onTap: () {
|
||||
mapPassengerController.selectCarFromList(index);
|
||||
|
||||
if (mapPassengerController.selectedIndex != -1) {
|
||||
// Get.snackbar('You should select one'.tr, '',
|
||||
// backgroundColor: AppColor.greenColor);
|
||||
if (mapPassengerController.selectedIndex == 0) {
|
||||
box.write(BoxName.carType, 'Comfort');
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController
|
||||
.totalPassengerComfort;
|
||||
Get.defaultDialog(
|
||||
title: 'Comfort',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/blob.png',
|
||||
text:
|
||||
'Best choice for comfort car and flexible route and stops point'
|
||||
.tr),
|
||||
confirm: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
mapPassengerController
|
||||
.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController
|
||||
.changeCashConfirmPageShown();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
} else if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
1) {
|
||||
box.write(BoxName.carType, 'Speed');
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController
|
||||
.totalPassengerSpeed;
|
||||
Get.defaultDialog(
|
||||
title: 'Speed',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/carspeed.png',
|
||||
text:
|
||||
'This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route'
|
||||
.tr),
|
||||
confirm: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
mapPassengerController
|
||||
.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController
|
||||
.changeCashConfirmPageShown();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
} else if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
2) {
|
||||
box.write(BoxName.carType, 'Delivery');
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController
|
||||
.totalPassengerMotoDelivery;
|
||||
Get.defaultDialog(
|
||||
title: 'Delivery',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/moto.png',
|
||||
text:
|
||||
'This is for delivery or a motorcycle.'
|
||||
.tr),
|
||||
confirm: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
mapPassengerController
|
||||
.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController
|
||||
.changeCashConfirmPageShown();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
} else if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
3) {
|
||||
box.write(BoxName.carType, 'Mashwari');
|
||||
mapPassengerController.totalPassenger = 50;
|
||||
Get.defaultDialog(
|
||||
title: 'Mashwari',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/freeRide.png',
|
||||
text:
|
||||
'Perfect for adventure seekers who want to experience something new and exciting'
|
||||
.tr),
|
||||
confirm: MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
mapPassengerController
|
||||
.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController
|
||||
.changeCashConfirmPageShown();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
Get.snackbar('You should select one'.tr, '',
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// if (mapPassengerController.selectedIndex != -1) {
|
||||
// // Get.snackbar('You should select one'.tr, '',
|
||||
// // backgroundColor: AppColor.greenColor);
|
||||
// if (mapPassengerController.selectedIndex == 0) {
|
||||
// box.write(BoxName.carType, 'Comfort');
|
||||
// mapPassengerController.totalPassenger =
|
||||
// mapPassengerController.totalPassengerComfort;
|
||||
// } else if (mapPassengerController.selectedIndex ==
|
||||
// 1) {
|
||||
// box.write(BoxName.carType, 'Speed');
|
||||
// } else if (mapPassengerController.selectedIndex ==
|
||||
// 2) {
|
||||
// box.write(BoxName.carType, 'Delivery');
|
||||
// mapPassengerController.totalPassenger =
|
||||
// mapPassengerController
|
||||
// .totalPassengerMotoDelivery;
|
||||
// } else if (mapPassengerController.selectedIndex ==
|
||||
// 3) {
|
||||
// box.write(BoxName.carType, 'FreeRide');
|
||||
// mapPassengerController.totalPassenger = 50;
|
||||
// }
|
||||
// mapPassengerController.isBottomSheetShown = false;
|
||||
// mapPassengerController.update();
|
||||
// mapPassengerController.changeCashConfirmPageShown();
|
||||
// // mapPassengerController.confirmRideForFirstDriver();
|
||||
// } else {
|
||||
// Get.snackbar('You should select one'.tr, '',
|
||||
// backgroundColor: AppColor.redColor);
|
||||
// }
|
||||
// })
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
// ;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class Burc extends StatelessWidget {
|
||||
const Burc({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (mapPassengerController) {
|
||||
final passengerWallet =
|
||||
double.tryParse(box.read(BoxName.passengerWalletTotal)) ??
|
||||
0.0; // Handle potential parsing errors
|
||||
|
||||
return mapPassengerController.data.isNotEmpty &&
|
||||
mapPassengerController.isBottomSheetShown &&
|
||||
!mapPassengerController.rideConfirm
|
||||
? Positioned(
|
||||
bottom: Get.height * .41,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (passengerWallet < 0.0) // Use if statement for clarity
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: AppColor.redColor.withOpacity(.5),
|
||||
),
|
||||
height: 50,
|
||||
width: Get.width,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () async => await Get.find<
|
||||
TextToSpeechController>()
|
||||
.speakText('you have a negative balance of'
|
||||
.tr +
|
||||
'${passengerWallet.toStringAsFixed(2)}'
|
||||
' in your'
|
||||
.tr +
|
||||
' ${AppInformation.appName}'
|
||||
' wallet due to a previous trip.'
|
||||
.tr),
|
||||
icon: const Icon(Icons.headphones)),
|
||||
Text(
|
||||
'${'you have a negative balance of'.tr}${'${passengerWallet.toStringAsFixed(2)}\n${' in your'.tr}'} ${AppInformation.appName}${' wallet due to a previous trip.'.tr}',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CarDialogue extends StatelessWidget {
|
||||
const CarDialogue({
|
||||
super.key,
|
||||
required this.textToSpeechController,
|
||||
required this.image,
|
||||
required this.text,
|
||||
});
|
||||
|
||||
final TextToSpeechController textToSpeechController;
|
||||
final String image, text;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
image,
|
||||
width: 50,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
textToSpeechController.speakText(
|
||||
text,
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.headphones)),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
text.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
import 'package:SEFER/constant/info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/home/my_wallet/passenger_wallet.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
|
||||
class CashConfirmPageShown extends StatelessWidget {
|
||||
CashConfirmPageShown({
|
||||
super.key,
|
||||
});
|
||||
PaymentController paymentController = Get.put(PaymentController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
left: 5,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
height: controller.isCashConfirmPageShown
|
||||
? controller.cashConfirmPageShown
|
||||
: 0,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Payment Method'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 22),
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () =>
|
||||
// controller.changeCashConfirmPageShown(),
|
||||
// icon: const Icon(Icons.close),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (paymentController) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.wallet_outlined,
|
||||
size: 25,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${AppInformation.appName} Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
// '${'Your Wallet balance is '.tr}JD ',
|
||||
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()}${' \$'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Checkbox.adaptive(
|
||||
value: paymentController.isWalletChecked,
|
||||
onChanged: (value) {
|
||||
paymentController
|
||||
.onChangedPaymentMethodWallet(value);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color: Colors.green[400],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
controller.changeCashConfirmPageShown();
|
||||
controller.isSearchingWindow = true;
|
||||
controller.confirmRideForFirstDriver();
|
||||
controller.update();
|
||||
},
|
||||
child: Text(
|
||||
'CASH',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Checkbox.adaptive(
|
||||
value: controller.isCashChecked,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.onChangedPaymentMethodCash(value);
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
// GetBuilder<PaymentController>(
|
||||
// builder: (paymentController) =>
|
||||
// (paymentController.isWalletChecked == false &&
|
||||
// paymentController.isCashChecked == true
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// controller.changeCashConfirmPageShown();
|
||||
// },
|
||||
// )
|
||||
// : const SizedBox())),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (paymentController) => (box
|
||||
.read(BoxName.passengerWalletTotal) ==
|
||||
null ||
|
||||
double.parse(box
|
||||
.read(BoxName.passengerWalletTotal)) <
|
||||
controller.totalPassenger)
|
||||
? Column(
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'To use Wallet charge it'.tr,
|
||||
onPressed: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Next as Cash \$\$!'.tr,
|
||||
onPressed: () {
|
||||
paymentController.isCashChecked = true;
|
||||
paymentController.isWalletChecked = false;
|
||||
paymentController.update();
|
||||
controller.changeCashConfirmPageShown();
|
||||
controller.isSearchingWindow = true;
|
||||
controller.confirmRideForFirstDriver();
|
||||
controller.update();
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller.changeCashConfirmPageShown();
|
||||
controller.isSearchingWindow = true;
|
||||
controller.confirmRideForFirstDriver();
|
||||
controller.update();
|
||||
},
|
||||
), // Add a fallback widget if none of the conditions are met
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import 'hexegone_clipper.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: ((controller) => controller.rideConfirm
|
||||
? Positioned(
|
||||
top: Get.height * .1,
|
||||
left: Get.width * .1,
|
||||
right: Get.width * .1,
|
||||
child: ClipPath(
|
||||
clipper:
|
||||
HexagonClipper(), // CustomClipper to create a hexagon shape
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(microseconds: 300),
|
||||
height: 250,
|
||||
width: 250,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// gradient: const LinearGradient(
|
||||
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||
// begin: Alignment.topLeft,
|
||||
// end: Alignment.bottomCenter,
|
||||
// ),
|
||||
// border: Border.all(),
|
||||
// color: AppColor.secondaryColor,
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Waiting for Driver ...'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// print(controller.dataCarsLocationByPassenger);
|
||||
// },
|
||||
// icon: const Icon(Icons.add),
|
||||
// ),
|
||||
// Text(
|
||||
// controller.dataCarsLocationByPassenger['message']
|
||||
// [controller.carsOrder]['phone']
|
||||
// .toString(),
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['first_name']} ${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['last_name']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Age is '.tr +
|
||||
controller
|
||||
.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['age']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['make']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['model']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Rating is '.tr +
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['ratingDriver']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(border: Border.all(width: 2)),
|
||||
child: Text(
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['car_plate']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox()));
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
// import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class DriverTimeArrivePassengerPage extends StatelessWidget {
|
||||
const DriverTimeArrivePassengerPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) {
|
||||
return controller.remainingTime == 0
|
||||
? Positioned(
|
||||
bottom: Get.height * .35,
|
||||
right: Get.width * .05,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
start: 5, end: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
controller.durationByPassenger.toString() +
|
||||
' to arrive you.'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
" ${DateFormat('h:mm a').format(controller.newTime)}",
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
// DbSql sql = DbSql.instance;
|
||||
if (box.read(BoxName.addWork).toString() == '' ||
|
||||
box.read(BoxName.addHome).toString() == '') {
|
||||
box.write(BoxName.addWork, 'addWork');
|
||||
box.write(BoxName.addHome, 'addHome');
|
||||
}
|
||||
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .9,
|
||||
height: 40,
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.only(),
|
||||
gapPadding: 4,
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.redColor,
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: controller.hintTextDestinationPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeDestinationController.clear();
|
||||
controller.clearPlacesDestination();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.red[300],
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeDestinationController,
|
||||
onChanged: (value) {
|
||||
if (controller
|
||||
.placeDestinationController.text.length >
|
||||
5) {
|
||||
controller.getPlaces();
|
||||
controller.changeHeightPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 4),
|
||||
child: Text(
|
||||
'Pick from map'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (box.read(BoxName.addWork) == 'addWork') {
|
||||
controller.workLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
} else {
|
||||
controller.hintTextDestinationPoint = 'To Work';
|
||||
print(box.read(BoxName.addWork));
|
||||
final latLng = LatLng(
|
||||
double.parse(
|
||||
box.read(BoxName.addWork).split(',')[0]),
|
||||
double.parse(
|
||||
box.read(BoxName.addWork).split(',')[1]),
|
||||
);
|
||||
print(latLng);
|
||||
controller.newMyLocation = latLng;
|
||||
controller.update();
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
Get.defaultDialog(
|
||||
title: 'Do you want to change Work location',
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Yes'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
controller.workLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
}));
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenColor.withOpacity(.4),
|
||||
border: Border.all()),
|
||||
child: Text(
|
||||
'${'Work :'.tr} ${box.read(BoxName.addWork).toString() == 'addWork' ? 'Add Work' : box.read(BoxName.addWork).toString().split(',')[0] + box.read(BoxName.addWork).toString().split(',')[1]} '),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onLongPress: () {
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'Do you want to change Home location'.tr,
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Yes'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
controller.homeLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
}));
|
||||
},
|
||||
onTap: () {
|
||||
if (box.read(BoxName.addHome) == 'addHome') {
|
||||
controller.homeLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
} else {
|
||||
controller.hintTextDestinationPoint = 'To Home';
|
||||
print(box.read(BoxName.addHome));
|
||||
final latLng = LatLng(
|
||||
double.parse(
|
||||
box.read(BoxName.addHome).split(',')[0]),
|
||||
double.parse(
|
||||
box.read(BoxName.addHome).split(',')[1]),
|
||||
);
|
||||
print(latLng);
|
||||
controller.newMyLocation = latLng;
|
||||
controller.update();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.yellowColor.withOpacity(.4),
|
||||
border: Border.all()),
|
||||
child: Text(
|
||||
'Home : ${box.read(BoxName.addHome) == 'addHome' ? 'Add Home' : box.read(BoxName.addHome)} '),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
), //
|
||||
),
|
||||
// controller.placesDestination.isEmpty
|
||||
// ? InkWell(
|
||||
// onTap: () {
|
||||
// controller.changeMainBottomMenuMap();
|
||||
// controller.changePickerShown();
|
||||
// },
|
||||
// child: Text(
|
||||
// 'Choose from Map'.tr,
|
||||
// style:
|
||||
// AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
Container(
|
||||
height: controller.placesDestination.isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesDestination.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesDestination[index];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']['location']['lat'],
|
||||
'longitude': res['geometry']['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.recentLocations);
|
||||
|
||||
controller.changeHeightPlaces();
|
||||
|
||||
controller.passengerLocation = controller.newMyLocation;
|
||||
controller.myDestination = LatLng(
|
||||
double.parse(
|
||||
res['geometry']['location']['lat'].toString()),
|
||||
double.parse(
|
||||
res['geometry']['location']['lng'].toString()),
|
||||
);
|
||||
controller.convertHintTextDestinationNewPlaces(index);
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.passengerStartLocationFromMap = true;
|
||||
controller.isPickerShown = true;
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
// DbSql sql = DbSql.instance;
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .75,
|
||||
height: 40,
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
child: TextFormField(
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.only(),
|
||||
gapPadding: 4,
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.redColor,
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: controller.hintTextStartPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeStartController.clear();
|
||||
controller.clearPlacesStart();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.red[300],
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeStartController,
|
||||
onChanged: (value) {
|
||||
if (controller.placeStartController.text.length > 5) {
|
||||
controller.getPlacesStart();
|
||||
controller.changeHeightStartPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.startLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.map_outlined,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// controller.placesDestination.isEmpty
|
||||
// ? InkWell(
|
||||
// onTap: () {
|
||||
// controller.startLocationFromMap = true;
|
||||
// controller.changeMainBottomMenuMap();
|
||||
// controller.changePickerShown();
|
||||
// },
|
||||
// child: Text(
|
||||
// 'Choose from Map Start Point'.tr,
|
||||
// style:
|
||||
// AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
Container(
|
||||
height:
|
||||
controller.placesStart.isNotEmpty ? controller.height : 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesStart.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesStart[index];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
// if (controller.currentLocationToFormPlaces == true) {
|
||||
// controller.newStartPointLocation =
|
||||
// controller.myLocation;
|
||||
// } else {
|
||||
// controller.myLocation =
|
||||
// controller.newStartPointLocation;
|
||||
// }
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']['location']['lat'],
|
||||
'longitude': res['geometry']['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.recentLocations);
|
||||
|
||||
controller.convertHintTextStartNewPlaces(index);
|
||||
controller.currentLocationString = res['name'];
|
||||
controller.placesStart = [];
|
||||
controller.placeStartController.clear();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
||||
// DbSql sql = DbSql.instance;
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.only(),
|
||||
gapPadding: 4,
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.redColor,
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: controller.hintTextwayPoint0.tr,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.allTextEditingPlaces[index].clear();
|
||||
controller.clearPlaces(index);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.red[300],
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.allTextEditingPlaces[index],
|
||||
onChanged: (value) {
|
||||
if (controller.allTextEditingPlaces[index].text.length >
|
||||
5) {
|
||||
controller.getPlacesListsWayPoint(index);
|
||||
controller.changeHeightPlacesAll(index);
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.placeListResponseAll[index].isEmpty
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.startLocationFromMapAll[index] = true;
|
||||
controller.wayPointIndex = index;
|
||||
print(controller.wayPointIndex);
|
||||
Get.back();
|
||||
// controller.changeMainBottomMenuMap();
|
||||
controller.changeWayPointStopsSheet();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
'Choose from Map'.tr + ' $index'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
height: controller.placeListResponseAll[index].isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placeListResponseAll[index].length,
|
||||
itemBuilder: (BuildContext context, int i) {
|
||||
var res = controller.placeListResponseAll[index][i];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
if (controller.currentLocationToFormPlacesAll[index] ==
|
||||
true) {
|
||||
controller.newStartPointLocation =
|
||||
controller.passengerLocation;
|
||||
} else {
|
||||
controller.passengerLocation =
|
||||
controller.newStartPointLocation;
|
||||
}
|
||||
|
||||
controller.convertHintTextPlaces(index, res);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:SEFER/controller/home/points_for_rider_controller.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
|
||||
class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
GoogleMapPassengerWidget({
|
||||
super.key,
|
||||
});
|
||||
WayPointController wayPointController = Get.put(WayPointController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Positioned(
|
||||
bottom: Get.height * .2,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
onLongPress: (argument) {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go to this site'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
Text('${argument.latitude},${argument.longitude}'),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
if (controller.dataCarsLocationByPassenger != null) {
|
||||
await controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${argument.latitude.toString()},${argument.longitude.toString()}');
|
||||
|
||||
Get.back();
|
||||
controller.bottomSheet();
|
||||
controller.showBottomSheet1();
|
||||
} else {
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
'We Are Sorry That we dont have cars in your Location!'
|
||||
.tr,
|
||||
'',
|
||||
colorText: AppColor.redColor,
|
||||
duration: const Duration(seconds: 11),
|
||||
instantInit: true,
|
||||
snackPosition: SnackPosition.TOP,
|
||||
titleText: Text(
|
||||
'Error'.tr,
|
||||
style:
|
||||
const TextStyle(color: AppColor.redColor),
|
||||
),
|
||||
messageText: Text(
|
||||
'We Are Sorry That we dont have cars in your Location!'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
icon: const Icon(Icons.error),
|
||||
shouldIconPulse: true,
|
||||
maxWidth: double.infinity,
|
||||
margin: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
borderRadius: 8,
|
||||
borderColor: AppColor.redColor,
|
||||
borderWidth: 2,
|
||||
backgroundColor: AppColor.secondaryColor,
|
||||
leftBarIndicatorColor: AppColor.redColor,
|
||||
boxShadows: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.25),
|
||||
blurRadius: 4,
|
||||
spreadRadius: 2,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
backgroundGradient: const LinearGradient(
|
||||
colors: [
|
||||
AppColor.redColor,
|
||||
AppColor.accentColor
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
// mainButton: TextButton(
|
||||
// onPressed: () {
|
||||
// controller.getCarsLocationByPassenger();
|
||||
// },
|
||||
// child: Text(
|
||||
// 'Try Again'.tr,
|
||||
// style: const TextStyle(
|
||||
// color: AppColor.secondaryColor),
|
||||
// ),
|
||||
// ),
|
||||
onTap: (GetSnackBar snackBar) {
|
||||
// Do something when the snackbar is tapped.
|
||||
},
|
||||
isDismissible: true,
|
||||
showProgressIndicator: false,
|
||||
dismissDirection: DismissDirection.up,
|
||||
progressIndicatorController: null,
|
||||
progressIndicatorBackgroundColor:
|
||||
Colors.transparent,
|
||||
progressIndicatorValueColor: null,
|
||||
snackStyle: SnackStyle.GROUNDED,
|
||||
forwardAnimationCurve: Curves.easeInToLinear,
|
||||
reverseAnimationCurve: Curves.easeInOut,
|
||||
animationDuration:
|
||||
const Duration(milliseconds: 4000),
|
||||
barBlur: 8,
|
||||
overlayBlur: 0,
|
||||
snackbarStatus: null,
|
||||
overlayColor:
|
||||
AppColor.primaryColor.withOpacity(0.5),
|
||||
userInputForm: null,
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
// controller.changeBottomSheetShown();
|
||||
// controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: controller.passengerLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
markers: controller.markers.toSet(),
|
||||
// {
|
||||
// if (controller.statusRide != 'Apply' ||
|
||||
// !controller.rideTimerBegin)
|
||||
// for (var carLocation in controller.carLocationsModels)
|
||||
|
||||
// // Marker(
|
||||
// // // anchor: const Offset(4, 4),
|
||||
// // position: LatLng(
|
||||
// // carLocation.latitude,
|
||||
// // carLocation.longitude,
|
||||
// // ),
|
||||
// // icon: controller.carIcon,
|
||||
// // markerId: MarkerId(carLocation.toString()),
|
||||
// // rotation: carLocation.heading,
|
||||
// // ),
|
||||
// // controller.carMarrkerAplied,
|
||||
// if (controller.statusRide == 'Apply')
|
||||
// // for (var carLocation
|
||||
// // in controller.driverCarsLocationToPassengerAfterApplied)
|
||||
// Marker(
|
||||
// // anchor: const Offset(4, 4),
|
||||
// position: LatLng(
|
||||
// double.parse(
|
||||
// controller
|
||||
// .datadriverCarsLocationToPassengerAfterApplied[
|
||||
// 'message'][0]['latitude'],
|
||||
// ),
|
||||
// double.parse(
|
||||
// controller
|
||||
// .datadriverCarsLocationToPassengerAfterApplied[
|
||||
// 'message'][0]['longitude'],
|
||||
// ),
|
||||
// ), //carLocation,
|
||||
// icon: controller.carIcon,
|
||||
// rotation: double.parse(controller
|
||||
// .datadriverCarsLocationToPassengerAfterApplied[
|
||||
// 'message'][0]['heading']),
|
||||
// markerId: MarkerId(controller
|
||||
// .datadriverCarsLocationToPassengerAfterApplied[
|
||||
// 'message'][0]['longitude']
|
||||
// .toString())),
|
||||
// for (int i = 1;
|
||||
// i < controller.coordinatesWithoutEmpty.length - 1;
|
||||
// i++)
|
||||
// Marker(
|
||||
// // anchor: const Offset(4, 4),
|
||||
// position: LatLng(
|
||||
// double.parse(controller.coordinatesWithoutEmpty[i]
|
||||
// .split(',')[0]),
|
||||
// double.parse(controller.coordinatesWithoutEmpty[i]
|
||||
// .split(',')[1])),
|
||||
// icon: controller.tripIcon,
|
||||
// markerId: MarkerId(
|
||||
// controller.coordinatesWithoutEmpty[i].toString())),
|
||||
// if (controller.isMarkersShown)
|
||||
// Marker(
|
||||
// markerId: MarkerId('MyLocation'.tr),
|
||||
// position: controller.newStartPointLocation,
|
||||
// draggable: true,
|
||||
// icon: controller.startIcon,
|
||||
// ),
|
||||
// if (controller.isMarkersShown)
|
||||
// Marker(
|
||||
// markerId: MarkerId('Destination'.tr),
|
||||
// position: controller.myDestination,
|
||||
// draggable: true,
|
||||
// icon: controller.endIcon,
|
||||
// ),
|
||||
// if (controller.haveSteps)
|
||||
// Marker(
|
||||
// markerId: MarkerId('StartSteps'.tr),
|
||||
// position: LatLng(
|
||||
// double.parse(
|
||||
// controller.placesCoordinate[0].split(',')[0]),
|
||||
// double.parse(
|
||||
// controller.placesCoordinate[0].split(',')[1])),
|
||||
// draggable: true,
|
||||
// icon: controller.startIcon,
|
||||
// ),
|
||||
// if (controller.haveSteps)
|
||||
// Marker(
|
||||
// markerId: MarkerId('EndSteps'.tr),
|
||||
// position: controller.latestPosition,
|
||||
// draggable: true,
|
||||
// icon: controller.endIcon,
|
||||
// ),
|
||||
// },
|
||||
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route'),
|
||||
points: controller.polylineCoordinates,
|
||||
color: AppColor.primaryColor,
|
||||
width: 5,
|
||||
),
|
||||
|
||||
Polyline(
|
||||
zIndex: 1,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route0'),
|
||||
points: controller.polylineCoordinatesPointsAll[0],
|
||||
color: AppColor.blueColor,
|
||||
width: 5,
|
||||
),
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route1'),
|
||||
points: controller.polylineCoordinatesPointsAll[1],
|
||||
color: AppColor.yellowColor,
|
||||
width: 5,
|
||||
),
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route2'),
|
||||
points: controller.polylineCoordinatesPointsAll[2],
|
||||
color: AppColor.greenColor,
|
||||
width: 5,
|
||||
),
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId: const PolylineId('route3'),
|
||||
points: controller.polylineCoordinatesPointsAll[2],
|
||||
color: AppColor.deepPurpleAccent,
|
||||
width: 5,
|
||||
),
|
||||
// Polyline(
|
||||
// zIndex: 2,
|
||||
// consumeTapEvents: true,
|
||||
// geodesic: true,
|
||||
// endCap: Cap.buttCap,
|
||||
// startCap: Cap.buttCap,
|
||||
// visible: true,
|
||||
// polylineId: PolylineId('g'),
|
||||
// points: [
|
||||
// LatLng(controller.southwest.latitude,
|
||||
// controller.southwest.longitude),
|
||||
// LatLng(controller.northeast.latitude,
|
||||
// controller.northeast.longitude)
|
||||
// ],
|
||||
// color: AppColor.primaryColor,
|
||||
// width: 5,
|
||||
// ),
|
||||
},
|
||||
// circles: {
|
||||
// Circle(
|
||||
// circleId: const CircleId('kk'),
|
||||
// center: controller.mylocation,
|
||||
// radius: 60,
|
||||
// fillColor: AppColor.primaryColor,)
|
||||
// },
|
||||
|
||||
circles: <Circle>{
|
||||
Circle(
|
||||
circleId: const CircleId('circle_id'),
|
||||
center: controller.passengerLocation,
|
||||
radius: 100,
|
||||
fillColor: Colors.blue.withOpacity(0.3),
|
||||
strokeColor: Colors.blue,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
},
|
||||
|
||||
mapType:
|
||||
controller.mapType ? MapType.satellite : MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
||||
|
||||
// indoorViewEnabled: true,
|
||||
trafficEnabled: controller.mapTrafficON,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
int waypointsLength =
|
||||
Get.find<WayPointController>().wayPoints.length;
|
||||
int index = controller.wayPointIndex;
|
||||
if (waypointsLength > 0) {
|
||||
controller.placesCoordinate[index] =
|
||||
'${position.target.latitude.toString()},${position.target.longitude}';
|
||||
}
|
||||
if (controller.startLocationFromMap == true) {
|
||||
controller.newStartPointLocation = position.target;
|
||||
} else if (controller.passengerStartLocationFromMap == true) {
|
||||
controller.newStartPointLocation = position.target;
|
||||
}
|
||||
controller.newMyLocation = position.target;
|
||||
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HexagonClipper extends CustomClipper<Path> {
|
||||
@override
|
||||
Path getClip(Size size) {
|
||||
final path = Path();
|
||||
final height = size.height;
|
||||
final width = size.width;
|
||||
final centerX = width / 2;
|
||||
final centerY = height / 2;
|
||||
final radius = width / 2;
|
||||
|
||||
const angle = 2 * pi / 10; // Angle between each side of the hexagon
|
||||
|
||||
// Start at the top right vertex of the hexagon
|
||||
final startX = centerX + radius * cos(0);
|
||||
final startY = centerY + radius * sin(0);
|
||||
path.moveTo(startX, startY);
|
||||
|
||||
// Draw the remaining sides of the hexagon
|
||||
for (int i = 1; i < 10; i++) {
|
||||
final x = centerX + radius * cos(angle * i);
|
||||
final y = centerY + radius * sin(angle * i);
|
||||
path.lineTo(x, y);
|
||||
}
|
||||
|
||||
path.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldReclip(HexagonClipper oldClipper) => false;
|
||||
}
|
||||
|
||||
class ArrowClipper extends CustomClipper<Path> {
|
||||
@override
|
||||
Path getClip(Size size) {
|
||||
final path = Path();
|
||||
path.moveTo(0, size.height / 2);
|
||||
path.lineTo(size.width / 2, 0);
|
||||
path.lineTo(size.width, size.height / 2);
|
||||
path.lineTo(size.width / 2, size.height);
|
||||
path.close();
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldReclip(ArrowClipper oldClipper) => false;
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/functions/upload_image.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 85,
|
||||
left: 6,
|
||||
child: Builder(builder: (context) {
|
||||
return Column(
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller.changeMapType();
|
||||
// Toast.show(context, 'This is a toast message!');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.satellite_alt,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller.changeMapTraffic();
|
||||
// Toast.show(context, 'This is a toast message!');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.streetview_sharp,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
// if (Platform.isIOS)
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller.mapController?.animateCamera(
|
||||
CameraUpdate.newLatLng(LatLng(
|
||||
controller.passengerLocation.latitude,
|
||||
controller.passengerLocation.longitude)));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.location_on,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// await Get.find<AudioRecorderController>().stopRecording();
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.voice_chat,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// await CRUD().allMethodForAI(
|
||||
// 'name,fullName,address,idNumber,cardId,dob',
|
||||
// AppLink.uploadEgypt,
|
||||
// 'idFront');
|
||||
//
|
||||
// // await ImageController().choosImage(
|
||||
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
|
||||
// // 'FrontId');
|
||||
// // AC credentials = AC();
|
||||
// // String apiKey = AK.payPalSecret;
|
||||
// // String convertedStringN = credentials.c(
|
||||
// // credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
// // print('Converted v: $convertedStringN');
|
||||
//
|
||||
// // String retrievedStringS = credentials.r(
|
||||
// // credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
// // cs);
|
||||
// // print('Retrieved String: $retrievedStringS');
|
||||
// // //
|
||||
// // if (retrievedStringS == apiKey) {
|
||||
// // print('same');
|
||||
// // }
|
||||
//
|
||||
// // print(box.read(BoxName.passengerWalletTotal));
|
||||
// // print(box.read(BoxName.name));
|
||||
// // print(box.read(BoxName.phone));
|
||||
// // print(box.read(BoxName.email));
|
||||
// // await Get.find<PaymentController>()
|
||||
// // .payWithPayMob(context, '1100', 'EGP');
|
||||
// // Initiates a payment with a card using the FlutterPaymob instance
|
||||
//
|
||||
// // NotificationController()
|
||||
// // .showNotification('Order', 'hi this is', 'tone1');
|
||||
// // Get.to(() => DriverCallPage());
|
||||
// // print(controller.carLocationsModels);
|
||||
// // controller.getKazanPercent();
|
||||
// // PassengerCallPage(
|
||||
// // channelName: '',
|
||||
// // token: '',
|
||||
// // remoteID: '',
|
||||
// // )
|
||||
// // Get.to(() => const CallPage());
|
||||
// // print(box.read(BoxName.lang));
|
||||
// await Get.find<AudioRecorderController>().startRecording();
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Get.put(AudioRecorderController()).isRecording
|
||||
// ? Icons.stop
|
||||
// : Icons.start,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
})),
|
||||
);
|
||||
}
|
||||
@@ -1,479 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/map_widget.dart/form_search_places_destenation.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
const MainBottomMenuMap({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
bottom: 3,
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: GestureDetector(
|
||||
onVerticalDragUpdate: (DragUpdateDetails details) {
|
||||
// Update the size of the GestureDetector based on the user's finger position.
|
||||
|
||||
// _height = details.globalPosition.dy;
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
height: controller.mainBottomMenuMapHeight,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
controller.isMainBottomMenuMap
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: InkWell(
|
||||
onTap: () =>
|
||||
controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: controller.isPickerShown
|
||||
? clickPointPosition(
|
||||
controller, context)
|
||||
: whereWidgetsmall(controller),
|
||||
),
|
||||
)),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons.ads_click,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? recentPlacesWidget(controller)
|
||||
: const SizedBox(),
|
||||
// controller.isMainBottomMenuMap
|
||||
// ? const SizedBox()
|
||||
// : InkWell(
|
||||
// onTap: () async {
|
||||
// controller.getCurrentLocationFormString();
|
||||
// },
|
||||
// child: Text(
|
||||
// 'From :'.tr +
|
||||
// ' ${controller.currentLocationString}'.tr,
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
// ),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Column(
|
||||
children: [
|
||||
// controller.currentLocationToFormPlaces
|
||||
// ? const SizedBox()
|
||||
// :
|
||||
// formSearchPlacesStart(),
|
||||
formSearchPlacesDestenation(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// MyElevatedButton(
|
||||
// title: 'Get Details of Trip'.tr,
|
||||
// onPressed: () async {
|
||||
// controller.changeMainBottomMenuMap();
|
||||
//
|
||||
// await controller.getMap(
|
||||
// '${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
// );
|
||||
// controller.currentLocationToFormPlaces =
|
||||
// false;
|
||||
// controller.placesDestination = [];
|
||||
// // controller.isCancelRidePageShown = true;
|
||||
// controller.clearPlacesStart();
|
||||
// controller.clearPlacesDestination();
|
||||
//
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
// controller.showBottomSheet1();
|
||||
// }),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changeWayPointSheet();
|
||||
},
|
||||
child: Text(
|
||||
"If you want add stop click here".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
SizedBox recentPlacesWidget(MapPassengerController controller) {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
return SizedBox(
|
||||
height: 50,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.recentPlaces.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return TextButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go this site'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: '',
|
||||
content: IconButton(
|
||||
onPressed: () {
|
||||
textToSpeechController
|
||||
.speakText('Are you want to go this site'.tr);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.headphones,
|
||||
size: 45,
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Yes'.tr,
|
||||
onPressed: () async {
|
||||
await controller.getLocation();
|
||||
await controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${controller.recentPlaces[index]['latitude']},${controller.recentPlaces[index]['longitude']}',
|
||||
);
|
||||
// controller.changePickerShown();
|
||||
controller.showBottomSheet1();
|
||||
|
||||
// controller.showBottomSheet1();
|
||||
Get.back();
|
||||
},
|
||||
));
|
||||
},
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Text(
|
||||
controller.recentPlaces[index]['name'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TextButton clickPointPosition(
|
||||
MapPassengerController controller, BuildContext context) {
|
||||
return TextButton(
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
if (controller.passengerStartLocationFromMap == true) {
|
||||
controller.newMyLocation = controller.newStartPointLocation;
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
await controller.getMap(
|
||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
'${controller.myDestination.latitude},${controller.myDestination.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces = false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
controller.passengerStartLocationFromMap = false;
|
||||
controller.isPickerShown = false;
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.hintTextStartPoint =
|
||||
// '${controller.newStartPointLocation.latitude.toStringAsFixed(4)} , ${controller.newStartPointLocation.longitude.toStringAsFixed(4)}';
|
||||
} else if (controller.startLocationFromMap == true) {
|
||||
controller.newMyLocation = controller.newStartPointLocation;
|
||||
controller.hintTextStartPoint =
|
||||
'${controller.newStartPointLocation.latitude.toStringAsFixed(4)} , ${controller.newStartPointLocation.longitude.toStringAsFixed(4)}';
|
||||
controller.startLocationFromMap = false;
|
||||
controller.isPickerShown = false;
|
||||
} else if (controller.workLocationFromMap == true) {
|
||||
controller.hintTextDestinationPoint = 'To Work'.tr;
|
||||
box.write(BoxName.addWork,
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}');
|
||||
controller.newMyLocation = controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
controller.workLocationFromMap = false;
|
||||
Get.snackbar('Work Saved'.tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
} else if (controller.homeLocationFromMap == true) {
|
||||
controller.hintTextDestinationPoint = 'To Home'.tr;
|
||||
box.write(BoxName.addHome,
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}');
|
||||
controller.newMyLocation = controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
controller.homeLocationFromMap = false;
|
||||
controller.update();
|
||||
Get.snackbar('Home Saved'.tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
} else {
|
||||
controller.hintTextDestinationPoint =
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}';
|
||||
controller.myDestination = controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.passengerStartLocationFromMap = true;
|
||||
controller.isPickerShown = true;
|
||||
await controller.mapController?.animateCamera(CameraUpdate.newLatLng(
|
||||
LatLng(controller.passengerLocation.latitude,
|
||||
controller.passengerLocation.longitude)));
|
||||
Get.defaultDialog(
|
||||
title: 'Destination selected'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Text(
|
||||
'Now select start pick'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
// controller.showBottomSheet1();
|
||||
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
controller.passengerStartLocationFromMap
|
||||
? 'Pick or Tap to confirm'.tr
|
||||
// ? 'Pick your ride location on the map - Tap to confirm'.tr
|
||||
: "Click here point".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Row whereWidgetsmall(MapPassengerController controller) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons.ads_click,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Text('${'Where to'.tr} ${box.read(BoxName.name)}')),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.noCarString == false
|
||||
? Text('Nearest Car for you about '.tr)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
child: null
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(6),
|
||||
// child: Text(
|
||||
// 'No Car in your site. Sorry!'.tr,
|
||||
// style: AppStyle.title
|
||||
// .copyWith(color: AppColor.secondaryColor),
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: AppColor.redColor, width: 3)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text((controller.nearestCar != null
|
||||
? controller.nearestDistance.toStringAsFixed(0)
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FavioratePlacesDialogu extends StatelessWidget {
|
||||
const FavioratePlacesDialogu({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
List favoritePlaces =
|
||||
await sql.getAllData(TableName.placesFavorite);
|
||||
// print(favoritePlaces);
|
||||
Get.defaultDialog(
|
||||
title: 'Favorite Places'.tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
height: 300,
|
||||
child: favoritePlaces.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.hourglass_empty_rounded,
|
||||
size: 99,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
Text(
|
||||
'You Dont Have Any places yet !'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: favoritePlaces.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
await controller.getLocation();
|
||||
await controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||
);
|
||||
// controller.changePickerShown();
|
||||
controller.showBottomSheet1();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
},
|
||||
child: Text(
|
||||
favoritePlaces[index]['name'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.deleteData(
|
||||
TableName.placesFavorite,
|
||||
favoritePlaces[index]['id']);
|
||||
Get.back();
|
||||
// ignore: use_build_context_synchronously
|
||||
Toast.show(
|
||||
context,
|
||||
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
AppColor.redColor);
|
||||
// Get.snackbar('Deleted'.tr,
|
||||
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
// backgroundColor:
|
||||
// AppColor.accentColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_outlined),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Back'.tr, onPressed: () => Get.back()),
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'\u{1F3D8} ' 'Favorite Places'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/auth/captin/register_captin.dart';
|
||||
import 'package:SEFER/views/home/my_wallet/passenger_wallet.dart';
|
||||
import 'package:SEFER/views/home/profile/feed_back_page.dart';
|
||||
import 'package:SEFER/views/home/profile/order_history.dart';
|
||||
import 'package:SEFER/views/home/profile/promos_passenger_page.dart';
|
||||
import 'package:SEFER/views/home/profile/taarif_page.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../notification/notification_page.dart';
|
||||
import '../../widgets/icon_widget_menu.dart';
|
||||
import '../home_page.dart';
|
||||
import '../profile/passenger_profile_page.dart';
|
||||
|
||||
class MapMenuWidget extends StatelessWidget {
|
||||
const MapMenuWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Stack(children: [
|
||||
Positioned(
|
||||
right: 60,
|
||||
left: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
child: Opacity(
|
||||
alwaysIncludeSemantics: false,
|
||||
opacity: 1, // Adjust the opacity value as needed
|
||||
child: AnimatedContainer(
|
||||
width: Get.width * .6,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
transform: Matrix4.translationValues(
|
||||
controller.heightMenu * .1, 1, 1),
|
||||
curve: Curves.easeOutCubic,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.heightMenu,
|
||||
child: controller.heightMenuBool
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const NotificationPage(),
|
||||
transition: Transition.circularReveal,
|
||||
);
|
||||
},
|
||||
title: 'Notifications'.tr,
|
||||
icon: Icons.notifications),
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => PassengerProfilePage(),
|
||||
transition: Transition.zoom,
|
||||
);
|
||||
},
|
||||
icon: Icons.person,
|
||||
title: 'Profile'.tr,
|
||||
),
|
||||
IconWidgetMenu(
|
||||
title: 'Home'.tr,
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const HomePage(),
|
||||
transition: Transition.downToUp,
|
||||
curve: Curves.easeInOutExpo,
|
||||
);
|
||||
},
|
||||
icon: Icons.home),
|
||||
],
|
||||
)
|
||||
: const SizedBox(), // Choose the desired overlay color
|
||||
)),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
top: 110,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
width: controller.widthMenu,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
title: 'My Wallet'.tr,
|
||||
icon: Icons.wallet,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
Get.to(() => const OrderHistory());
|
||||
},
|
||||
title: 'Order History'.tr,
|
||||
icon: Icons.history,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const TaarifPage());
|
||||
},
|
||||
title: 'Tariff'.tr,
|
||||
icon: Icons.money,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
left: 5,
|
||||
top: 110,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
width: controller.widthMenu,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(const RegisterCaptin());
|
||||
},
|
||||
title: 'Driver'.tr,
|
||||
icon: WeatherIcons.wi_moon_14,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => FeedBackPage());
|
||||
},
|
||||
title: 'Feed Back'.tr,
|
||||
icon: Icons.feedback,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PromosPassengerPage());
|
||||
},
|
||||
title: 'Promos'.tr,
|
||||
icon: Icons.monetization_on,
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IconMainPageMap extends StatelessWidget {
|
||||
const IconMainPageMap({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final Callback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
future: Future.delayed(const Duration(milliseconds: 400)),
|
||||
builder: (context, snapshot) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(icon),
|
||||
Text(
|
||||
title.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
class MenuIconMapPageWidget extends StatelessWidget {
|
||||
const MenuIconMapPageWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 30,
|
||||
left: box.read(BoxName.lang) != 'ar' ? 5 : null,
|
||||
right: box.read(BoxName.lang) == 'ar' ? 5 : null,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.accentColor)),
|
||||
child: AnimatedCrossFade(
|
||||
sizeCurve: Curves.bounceOut,
|
||||
duration: const Duration(
|
||||
milliseconds: 300), // Adjust the duration as needed
|
||||
crossFadeState: controller.heightMenuBool
|
||||
? CrossFadeState.showFirst
|
||||
: CrossFadeState.showSecond,
|
||||
firstChild: IconButton(
|
||||
onPressed: () {
|
||||
controller.getDrawerMenu();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
secondChild: IconButton(
|
||||
onPressed: () {
|
||||
controller.getDrawerMenu();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.menu,
|
||||
color: AppColor.accentColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class NewMainBottomSheet extends StatelessWidget {
|
||||
const NewMainBottomSheet({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width,
|
||||
height: Get.height * .15,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Home'.tr),
|
||||
const Icon(Icons.home),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Work'.tr),
|
||||
const Icon(Icons.work_outline),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: AppColor.blueColor.withOpacity(.5),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(Icons.search),
|
||||
Text(
|
||||
"${"Where you want go ".tr}${box.read(BoxName.name)} ?",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class PassengerRideLocationWidget extends StatelessWidget {
|
||||
const PassengerRideLocationWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (mapPassengerController) {
|
||||
return mapPassengerController.isPassengerRideLocationWidget
|
||||
? Positioned(
|
||||
bottom: 1,
|
||||
right: 1,
|
||||
left: 1,
|
||||
child: Container(
|
||||
height: Get.height * .2,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Center(
|
||||
child: Text('Choose ride location'.tr),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,418 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/functions/secure_storage.dart';
|
||||
import 'package:SEFER/controller/home/payment/credit_card_controller.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/digit_obsecur_formate.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class PaymentMethodPage extends StatelessWidget {
|
||||
const PaymentMethodPage({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
left: 5,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
height: controller.isPaymentMethodPageShown
|
||||
? controller.paymentPageShown
|
||||
: 0,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'My Card'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 22),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
controller.changePaymentMethodPageShown(),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Add Card'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// GetBuilder<CreditCardController>(
|
||||
// builder: (controller) => IconButton(
|
||||
// onPressed: () {
|
||||
// // controller.scanCard();
|
||||
// // Get.defaultDialog(content: OptionConfigureWidget(
|
||||
// // initialOptions: scanOptions,
|
||||
// // onScanOptionChanged: (newOptions) =>
|
||||
// // scanOptions = newOptions,
|
||||
// // ),
|
||||
// // );
|
||||
// },
|
||||
// icon: const Icon(Icons.contact_emergency_sharp),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const MyCreditCardWidget(),
|
||||
const Spacer(),
|
||||
GetBuilder<CreditCardController>(
|
||||
builder: (controller) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Add Credit Card'.tr,
|
||||
onPressed: () async {
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardNumber,
|
||||
controller
|
||||
.cardNumberController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardHolderName,
|
||||
controller
|
||||
.cardHolderNameController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.cvvCode,
|
||||
controller.cvvCodeController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.expiryDate,
|
||||
controller
|
||||
.expiryDateController.text);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class MyCreditCardWidget extends StatelessWidget {
|
||||
const MyCreditCardWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(CreditCardController());
|
||||
return GetBuilder<CreditCardController>(
|
||||
builder: (controller) => Container(
|
||||
height: Get.height * .4,
|
||||
width: Get.width * .9,
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||
gradient: LinearGradient(colors: [
|
||||
AppColor.secondaryColor,
|
||||
// AppColor.blueColor,
|
||||
// AppColor.greenColor,
|
||||
AppColor.accentColor,
|
||||
// AppColor.primaryColor,
|
||||
// AppColor.redColor,
|
||||
// AppColor.yellowColor
|
||||
]),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
spreadRadius: 3,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 3,
|
||||
color: AppColor.redColor),
|
||||
BoxShadow(
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 3,
|
||||
spreadRadius: 3,
|
||||
color: AppColor.redColor),
|
||||
],
|
||||
),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
getCardIcon(controller.cardNumberController
|
||||
.text), // Dynamic credit card icon
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .25,
|
||||
child: Text(
|
||||
'Card Number'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
height: 70,
|
||||
child: TextFormField(
|
||||
maxLength: 16,
|
||||
keyboardType: TextInputType.number,
|
||||
controller: controller.cardNumberController,
|
||||
style: const TextStyle(
|
||||
color: AppColor.blueColor,
|
||||
fontFamily: 'digital-counter-7',
|
||||
fontWeight: FontWeight.bold),
|
||||
decoration: const InputDecoration(
|
||||
helperStyle: TextStyle(
|
||||
fontFamily: 'digital-counter-7'),
|
||||
// labelText: 'Card Number',
|
||||
),
|
||||
inputFormatters: [DigitObscuringFormatter()],
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 16) {
|
||||
return 'Please enter a valid 16-digit card number'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.person),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .25,
|
||||
child: Text(
|
||||
'Holder Name',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: SizedBox(
|
||||
// height: 50,
|
||||
child: TextFormField(
|
||||
style: AppStyle.title,
|
||||
keyboardType: TextInputType.text,
|
||||
// maxLength: 16,
|
||||
controller: controller.cardHolderNameController,
|
||||
decoration: const InputDecoration(
|
||||
// labelText: 'Cardholder Name',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter the cardholder name'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.date_range_outlined),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Text(
|
||||
'Expiry Date',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .1,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
maxLength: 4,
|
||||
keyboardType: TextInputType.datetime,
|
||||
controller:
|
||||
controller.expiryDateController,
|
||||
style: AppStyle.title,
|
||||
decoration: const InputDecoration(),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter the expiry date'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.security),
|
||||
SizedBox(
|
||||
width: Get.width * .021,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Text(
|
||||
'CVV Code',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.number,
|
||||
style: const TextStyle(
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: 'digital-counter-7'),
|
||||
maxLength: 3,
|
||||
controller:
|
||||
controller.cvvCodeController,
|
||||
decoration: const InputDecoration(
|
||||
// labelText: 'CVV Code',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty &&
|
||||
value.length != 3) {
|
||||
return 'Please enter the CVV code'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(
|
||||
// height: 20,
|
||||
// ),
|
||||
MyElevatedButton(
|
||||
title: 'Save'.tr,
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
// final creditCard = CreditCardModel(
|
||||
// cardNumber: controller.cardNumberController.text,
|
||||
// cardHolderName:
|
||||
// controller.cardHolderNameController.text,
|
||||
// expiryDate: controller.expiryDateController.text,
|
||||
// cvvCode: controller.cvvCodeController.text,
|
||||
// );
|
||||
// Process the credit card details
|
||||
// You can use GetX to handle the logic here
|
||||
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
SecureStorage().saveData(BoxName.cardNumber,
|
||||
controller.cardNumberController.text);
|
||||
SecureStorage().saveData(BoxName.cardHolderName,
|
||||
controller.cardHolderNameController.text);
|
||||
SecureStorage().saveData(BoxName.cvvCode,
|
||||
controller.cvvCodeController.text);
|
||||
SecureStorage().saveData(BoxName.expiryDate,
|
||||
controller.expiryDateController.text);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
))));
|
||||
}
|
||||
|
||||
Widget getCardIcon(String cardNumber) {
|
||||
String cardType = detectCardType(
|
||||
cardNumber); // Function to detect card type based on the first digit
|
||||
|
||||
IconData iconData;
|
||||
Color iconColor;
|
||||
|
||||
switch (cardType) {
|
||||
case 'Visa':
|
||||
iconData = Icons.credit_card_rounded;
|
||||
iconColor = Colors.blue; // Change color for Visa cards
|
||||
break;
|
||||
case 'Mastercard':
|
||||
iconData = Icons.credit_card_rounded;
|
||||
iconColor = Colors.red; // Change color for Mastercard cards
|
||||
break;
|
||||
default:
|
||||
iconData = Icons.credit_card_rounded;
|
||||
iconColor = Colors.black; // Default color for other card types
|
||||
break;
|
||||
}
|
||||
|
||||
return Icon(
|
||||
iconData,
|
||||
color: iconColor,
|
||||
);
|
||||
}
|
||||
|
||||
String detectCardType(String cardNumber) {
|
||||
if (cardNumber.startsWith('4')) {
|
||||
return 'Visa';
|
||||
} else if (cardNumber.startsWith('5')) {
|
||||
return 'Mastercard';
|
||||
} else {
|
||||
return 'Other';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import 'form_search_places_destenation.dart';
|
||||
|
||||
class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
PickerAnimtionContainerFormPlaces({
|
||||
super.key,
|
||||
});
|
||||
final controller = MapPassengerController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// DbSql sql = DbSql.instance;
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 5,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.heightPickerContainer,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor, offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor, offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15),
|
||||
)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
controller.isPickerShown
|
||||
? const SizedBox()
|
||||
: Text(
|
||||
'Hi, Where to '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
controller.isPickerShown
|
||||
? InkWell(
|
||||
onTapDown: (details) {
|
||||
controller.changePickerShown();
|
||||
controller.changeHeightPlaces();
|
||||
},
|
||||
child: Container(
|
||||
height: 7,
|
||||
width: Get.width * .3,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.accentColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: AppColor.accentColor,
|
||||
)),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
controller.isPickerShown
|
||||
? InkWell(
|
||||
onTap: () {},
|
||||
child: formSearchPlacesDestenation(),
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
"Pick your destination from Map".tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
List favoritePlaces = await sql
|
||||
.getAllData(TableName.placesFavorite);
|
||||
print(favoritePlaces);
|
||||
Get.defaultDialog(
|
||||
title: 'Favorite Places'.tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
height: 300,
|
||||
child: favoritePlaces.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons
|
||||
.hourglass_empty_rounded,
|
||||
size: 99,
|
||||
color: AppColor
|
||||
.primaryColor,
|
||||
),
|
||||
Text(
|
||||
'You Dont Have Any places yet !'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount:
|
||||
favoritePlaces.length,
|
||||
itemBuilder:
|
||||
(BuildContext context,
|
||||
int index) {
|
||||
return Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await controller
|
||||
.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||
);
|
||||
controller
|
||||
.changePickerShown();
|
||||
controller
|
||||
.changeBottomSheetShown();
|
||||
controller
|
||||
.bottomSheet();
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
favoritePlaces[
|
||||
index]['name'],
|
||||
style:
|
||||
AppStyle.title,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.deleteData(
|
||||
TableName
|
||||
.placesFavorite,
|
||||
favoritePlaces[
|
||||
index]
|
||||
['id']);
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
'Deleted ',
|
||||
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
backgroundColor:
|
||||
AppColor
|
||||
.accentColor);
|
||||
},
|
||||
icon: const Icon(Icons
|
||||
.favorite_outlined),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
onCancel: () {},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Go To Favorite Places".tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.placesDestination.isEmpty)
|
||||
MyElevatedButton(
|
||||
title: 'Go to this Target'.tr,
|
||||
onPressed: () async {
|
||||
await controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.changePickerShown();
|
||||
controller.changeBottomSheetShown();
|
||||
controller.bottomSheet();
|
||||
// await sql
|
||||
// .getAllData(TableName.placesFavorite)
|
||||
// .then((value) => print(value));
|
||||
},
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.placesDestination.isEmpty)
|
||||
const SizedBox(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,328 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/admin/captain/form_captain.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/home/points_for_rider_controller.dart';
|
||||
|
||||
class PointsPageForRider extends StatelessWidget {
|
||||
PointsPageForRider({
|
||||
super.key,
|
||||
});
|
||||
MapPassengerController mapPassengerController =
|
||||
Get.put(MapPassengerController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(WayPointController());
|
||||
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
return Positioned(
|
||||
bottom: 2,
|
||||
left: 2,
|
||||
right: 2,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.wayPointSheetHeight,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView(
|
||||
children: [
|
||||
// const AppBarPointsPageForRider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
mapPassengerController.downPoints();
|
||||
},
|
||||
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
||||
),
|
||||
GetBuilder<WayPointController>(builder: (wayPointController) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
wayPointController.addWayPoints();
|
||||
controller.isWayPointStopsSheetUtilGetMap = true;
|
||||
},
|
||||
child: const Text('Add Stops'),
|
||||
),
|
||||
wayPointController.wayPoints.length > 1
|
||||
? ElevatedButton(
|
||||
onPressed: () async {
|
||||
mapPassengerController
|
||||
.getMapPointsForAllMethods();
|
||||
},
|
||||
child: const Text('Get Direction'),
|
||||
)
|
||||
: const SizedBox()
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: Get.height * .36,
|
||||
child: GetBuilder<WayPointController>(
|
||||
builder: (wayPointController) {
|
||||
return ReorderableListView(
|
||||
// The children of the list are the text fields
|
||||
children: wayPointController.wayPoints
|
||||
.asMap()
|
||||
.entries
|
||||
.map((entry) {
|
||||
final index = entry.key;
|
||||
final wayPoint = entry.value;
|
||||
return Padding(
|
||||
key: ValueKey(index),
|
||||
padding: const EdgeInsets.all(1),
|
||||
child: ListTile(
|
||||
leading: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.deepPurpleAccent,
|
||||
border: Border.all(),
|
||||
shape: BoxShape.rectangle),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Text(
|
||||
index.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)),
|
||||
title: InkWell(
|
||||
onTap: () {
|
||||
// showAddLocationDialog(context);
|
||||
Get.defaultDialog(
|
||||
content: SizedBox(
|
||||
width: Get.width,
|
||||
height: 400,
|
||||
child: mapPassengerController
|
||||
.placeListResponse[index]),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
color:
|
||||
AppColor.accentColor.withOpacity(.5)),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(mapPassengerController
|
||||
.currentLocationStringAll[index]
|
||||
.toString()),
|
||||
const Icon(
|
||||
Icons.reorder,
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
trailing: index > 0
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {
|
||||
wayPointController.removeTextField(index);
|
||||
},
|
||||
)
|
||||
: IconButton(
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
onPressed: () {},
|
||||
)),
|
||||
);
|
||||
}).toList(),
|
||||
|
||||
// The callback when the user reorders the text fields
|
||||
onReorder: (int oldIndex, int newIndex) {
|
||||
wayPointController.reorderTextFields(oldIndex, newIndex);
|
||||
},
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// GetBuilder<PointsForRiderController>(
|
||||
// builder: (controller) => Container(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// height: Get.height *
|
||||
// .5, // height: controller.heightPointsPageForRider,
|
||||
// width: Get.width,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 300,
|
||||
// child: ReorderableListView(
|
||||
// onReorder: (oldIndex, newIndex) {
|
||||
// if (oldIndex < newIndex) {
|
||||
// newIndex -= 1;
|
||||
// }
|
||||
// pointsForRiderController.locations.insert(
|
||||
// newIndex,
|
||||
// pointsForRiderController.locations
|
||||
// .removeAt(oldIndex));
|
||||
// },
|
||||
// children: [
|
||||
// for (int i = 0;
|
||||
// i < pointsForRiderController.locations.length;
|
||||
// i++)
|
||||
// ListTile(
|
||||
// key: Key('$i'),
|
||||
// title: DragTarget<int>(
|
||||
// onAccept: (int data) {
|
||||
// pointsForRiderController.locations
|
||||
// .insert(i, 'New Text Field');
|
||||
// },
|
||||
// builder: (context, candidateData, rejectedData) {
|
||||
// return Row(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// width: 300,
|
||||
// child: TextField(
|
||||
// controller: TextEditingController(
|
||||
// text: pointsForRiderController
|
||||
// .locations[i]),
|
||||
// onChanged: (value) {
|
||||
// pointsForRiderController
|
||||
// .locations[i] = value;
|
||||
// },
|
||||
// decoration: InputDecoration(
|
||||
// prefixIcon: IconButton(
|
||||
// onPressed: () {
|
||||
// pointsForRiderController
|
||||
// .removeLocation(i);
|
||||
// },
|
||||
// icon: const Icon(Icons.delete),
|
||||
// ),
|
||||
// labelText: 'Text Field ${i + 1}',
|
||||
// border: const OutlineInputBorder(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// // pointsForRiderController.onReorder(
|
||||
// // index, newIndex);
|
||||
// },
|
||||
// icon: const Icon(Icons.reorder),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ElevatedButton(
|
||||
// onPressed: () {
|
||||
// pointsForRiderController.addLocation('location');
|
||||
// },
|
||||
// child: const Text('Add Text Field'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ));
|
||||
}
|
||||
|
||||
void showAddLocationDialog(BuildContext context, int index) {
|
||||
final TextEditingController locationController = TextEditingController();
|
||||
// Get.put(WayPointController());
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Dialog.fullscreen(
|
||||
// title: const Text('Add Location'),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
size: 40,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Add Location'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.secondaryColor,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
child: formSearchCaptain(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class AppBarPointsPageForRider extends StatelessWidget {
|
||||
const AppBarPointsPageForRider({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios_new_rounded,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
backgroundColor: AppColor.primaryColor,
|
||||
maxRadius: 15,
|
||||
child: Icon(
|
||||
Icons.person,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
"Switch Rider".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.secondaryColor,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,341 +0,0 @@
|
||||
import 'package:SEFER/views/home/profile/feed_back_page.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/profile/profile_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class RideBeginPassenger extends StatelessWidget {
|
||||
const RideBeginPassenger({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProfileController profileController = Get.put(ProfileController());
|
||||
AudioRecorderController audioController =
|
||||
Get.put(AudioRecorderController());
|
||||
// Get.put(MapPassengerController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Begin' || !controller.statusRideFromStart) {
|
||||
return Positioned(
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 4,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: controller.statusRide == 'Begin' ? Get.height * .33 : 0,
|
||||
// width: 100,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundImage: NetworkImage(
|
||||
'https://ride.mobile-app.store/portrate_captain_image/${controller.driverId}.jpg'),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
controller.firstName,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
controller.make,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.model,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: <Widget>[
|
||||
const Text(''),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
controller.licensePlate,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Text(
|
||||
'${box.read(BoxName.carType)}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${controller.driverRate} 📈',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
controller.getDialog('Arrival time'.tr,
|
||||
'arrival time to reach your point'.tr, () {});
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'⏱️',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.arrivalTime,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
controller.getDialog(
|
||||
'Price of trip'.tr,
|
||||
'For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance'
|
||||
.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'💵 ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.totalPassenger.toStringAsFixed(2),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: IconButton(
|
||||
onPressed: () => Get.to(
|
||||
() => FeedBackPage(),
|
||||
transition: Transition.downToUp,
|
||||
),
|
||||
icon: const Icon(
|
||||
Icons.note_add,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
tooltip: ' Add Note', // Optional tooltip for clarity
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: audioController.isRecording == false
|
||||
? IconButton(
|
||||
onPressed: () async {
|
||||
await audioController.startRecording();
|
||||
Toast.show(context, 'Start Record'.tr,
|
||||
AppColor.greenColor);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.play_circle_fill_outlined,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
tooltip:
|
||||
' Add Note', // Optional tooltip for clarity
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () async {
|
||||
await audioController.stopRecording();
|
||||
Toast.show(context, 'Record saved'.tr,
|
||||
AppColor.greenColor);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.stop_circle,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
tooltip:
|
||||
' Add Note', // Optional tooltip for clarity
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
// StreamCounter(),
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color: controller.remainingTimeTimerRideBegin < 60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller.progressTimerRideBegin.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
controller.stringRemainingTimeRideBegin,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: Get.width * .15,
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
controller
|
||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sos_rounded,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: Get.width * .15,
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
print(box.read(BoxName.sosPhonePassenger));
|
||||
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
String phoneNumber = box
|
||||
.read(BoxName.sosPhonePassenger)
|
||||
.toString();
|
||||
// phoneNumber = phoneNumber.replaceAll('0', '');
|
||||
print(phoneNumber); // Output: 798583061
|
||||
var phone =
|
||||
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}';
|
||||
'${box.read(BoxName.sosPhonePassenger)}';
|
||||
controller.sendWhatsapp(phone);
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class StreamCounter extends StatelessWidget {
|
||||
const StreamCounter({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
// Build the UI based on the timer value
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
return StreamBuilder<int>(
|
||||
initialData: 0,
|
||||
stream: controller.timerController.stream,
|
||||
builder: (context, snapshot) {
|
||||
// Calculate the remaining time based on the current tick
|
||||
final remainingTime = controller.durationToRide - snapshot.data!;
|
||||
|
||||
// Format the remaining time as a string
|
||||
final formattedRemainingTime =
|
||||
'${(remainingTime / 60).floor()}:${(remainingTime % 60).toString().padLeft(2, '0')}';
|
||||
|
||||
// Return the UI widgets based on the remaining time
|
||||
return Column(
|
||||
children: [
|
||||
Text(formattedRemainingTime),
|
||||
// ElevatedButton(
|
||||
// onPressed: () {
|
||||
// // Handle button press here
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/profile/profile_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
class RideFromStartApp extends StatelessWidget {
|
||||
const RideFromStartApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProfileController profileController = Get.put(ProfileController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
return (controller.statusRideFromStart
|
||||
// || controller.statusRide == 'Begin'
|
||||
)
|
||||
? Positioned(
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 4,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'⏱️',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
box.read(BoxName.arrivalTime),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'📍',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.rideStatusFromStartApp['data']
|
||||
['distance']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .15,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'💵 ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
controller.rideStatusFromStartApp['data']
|
||||
['price'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundImage: NetworkImage(
|
||||
// '',
|
||||
// ),
|
||||
'https://ride.mobile-app.store/portrate_captain_image/${controller.rideStatusFromStartApp['data']['driver_id']}.jpg'),
|
||||
),
|
||||
Text(
|
||||
'${controller.rideStatusFromStartApp['data']['driverName']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'${controller.rideStatusFromStartApp['data']['rateDriver']} 📈',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${controller.rideStatusFromStartApp['data']['carType']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
controller
|
||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sos_rounded,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
print(box.read(BoxName.sosPhonePassenger));
|
||||
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
String phoneNumber = box
|
||||
.read(BoxName.sosPhonePassenger)
|
||||
.toString();
|
||||
// phoneNumber = phoneNumber.replaceAll('0', '');
|
||||
print(phoneNumber); // Output: 798583061
|
||||
var phone =
|
||||
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}';
|
||||
'${box.read(BoxName.sosPhonePassenger)}';
|
||||
controller.sendWhatsapp(phone);
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,211 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SearchingCaptainWindow extends StatelessWidget {
|
||||
const SearchingCaptainWindow({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (mapPassengerController) {
|
||||
return mapPassengerController.isSearchingWindow
|
||||
? Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .2,
|
||||
child: Column(
|
||||
// Use Stack for overlapping widgets
|
||||
children: [
|
||||
// Text elements
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: const LinearProgressIndicator(
|
||||
minHeight: 6,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'We search nearst Driver to you'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
Text(
|
||||
'please wait till driver accept your order'.tr,
|
||||
style: AppStyle.title,
|
||||
), // Timer logic
|
||||
_buildTimer(mapPassengerController),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildTimer(MapPassengerController mapPassengerController) {
|
||||
// Start timer at 0
|
||||
Timer? timer;
|
||||
|
||||
return StreamBuilder<int>(
|
||||
// Use StreamBuilder for timer updates
|
||||
stream: Stream.periodic(const Duration(seconds: 1))
|
||||
.map((_) => ++mapPassengerController.currentTimeSearchingCaptainWindow),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData && snapshot.data! > 30) {
|
||||
timer?.cancel(); // Cancel timer after 60 seconds
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: "Increase Your Trip Fee (Optional)".tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
Text(
|
||||
"We haven't found any drivers yet. Consider increasing your trip fee to make your offer more attractive to drivers."
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
mapPassengerController.increasFeeFromPassenger.text =
|
||||
(mapPassengerController.totalPassenger + 3)
|
||||
.toStringAsFixed(1);
|
||||
// mapPassengerController.increasFeeFromPassenger.text =
|
||||
// mapPassengerController.totalPassenger
|
||||
// .toStringAsFixed(1);
|
||||
mapPassengerController.update();
|
||||
},
|
||||
icon: Column(
|
||||
children: [
|
||||
Text(
|
||||
'3',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.arrow_circle_up,
|
||||
size: 30,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Form(
|
||||
key: mapPassengerController.increasFeeFormKey,
|
||||
child: MyTextForm(
|
||||
controller: mapPassengerController
|
||||
.increasFeeFromPassenger,
|
||||
label: mapPassengerController.totalPassenger
|
||||
.toStringAsFixed(2),
|
||||
hint: mapPassengerController.totalPassenger
|
||||
.toStringAsFixed(2),
|
||||
type: TextInputType.number),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// if ((double.parse(mapPassengerController
|
||||
// .increasFeeFromPassenger.text) >
|
||||
// totalPassenger)) {}
|
||||
mapPassengerController.increasFeeFromPassenger.text =
|
||||
(mapPassengerController.totalPassenger - 3)
|
||||
.toStringAsFixed(1);
|
||||
// mapPassengerController.increasFeeFromPassenger.text =
|
||||
// mapPassengerController.totalPassenger
|
||||
// .toStringAsFixed(1);
|
||||
mapPassengerController.update();
|
||||
},
|
||||
icon: Column(
|
||||
children: [
|
||||
Text(
|
||||
'3',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.arrow_drop_down_circle_outlined,
|
||||
size: 30,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
MyElevatedButton(
|
||||
title: "No, thanks",
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}),
|
||||
MyElevatedButton(
|
||||
title: "Increase Fee".tr,
|
||||
onPressed: () {
|
||||
mapPassengerController.increaseFeeByPassengerAndReOrder();
|
||||
})
|
||||
],
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"No accepted orders? Try raising your trip fee to attract riders."
|
||||
.tr,
|
||||
style: AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Update progress for circular indicator (0.0 to 1.0)
|
||||
final double progress =
|
||||
snapshot.data!.toDouble() / 30.0; // Normalize progress
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: progress, // Use calculated progress
|
||||
color: AppColor.blueColor,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
'${snapshot.data} ', // Display elapsed time
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor), // Adjust color for timer
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> timerForCancelTripFromPassenger() {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) {
|
||||
final isNearEnd =
|
||||
controller.remainingTime <= 5; // Define a threshold for "near end"
|
||||
|
||||
return controller.remainingTime > 0 && controller.remainingTime != 25
|
||||
? Positioned(
|
||||
bottom: 5,
|
||||
left: 10,
|
||||
right: 10,
|
||||
child: Container(
|
||||
height: 180,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
value: controller.progress,
|
||||
// Set the color based on the "isNearEnd" condition
|
||||
color: isNearEnd ? Colors.red : Colors.blue,
|
||||
),
|
||||
Text(
|
||||
'${controller.remainingTime}',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 30,
|
||||
),
|
||||
Text(
|
||||
'You can cancel Ride now'.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'After this period\nYou can\'t cancel!'.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import 'ride_begin_passenger.dart';
|
||||
|
||||
class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
const TimerToPassengerFromDriver({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.remainingTime == 0 &&
|
||||
(controller.isDriverInPassengerWay == true ||
|
||||
controller.timeToPassengerFromDriverAfterApplied > 0)) {
|
||||
// ) {
|
||||
return Positioned(
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: controller.remainingTime == 0 &&
|
||||
(controller.isDriverInPassengerWay == true ||
|
||||
controller.timeToPassengerFromDriverAfterApplied > 0)
|
||||
? 200
|
||||
: 0,
|
||||
// width: 100,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'You Can cancel Ride After Captain did not come in the time'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color: controller
|
||||
.remainingTimeToPassengerFromDriverAfterApplied <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller
|
||||
.progressTimerToPassengerFromDriverAfterApplied
|
||||
.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
controller.stringRemainingTimeToPassenger,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.phone,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
),
|
||||
controller.remainingTimeToPassengerFromDriverAfterApplied < 60
|
||||
? MyElevatedButton(
|
||||
title: 'You can cancel trip'.tr,
|
||||
onPressed: () async {
|
||||
await controller
|
||||
.calculateDistanceBetweenPassengerAndDriverBeforeCancelRide();
|
||||
})
|
||||
: const SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else if (controller.remainingTime == 0 &&
|
||||
controller.isDriverArrivePassenger == true) {
|
||||
return Positioned(
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: controller.remainingTime == 0 &&
|
||||
controller.isDriverArrivePassenger == true
|
||||
? 150
|
||||
: 0,
|
||||
// width: 100,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'The driver waitting you in picked location .'.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color:
|
||||
controller.remainingTimeDriverWaitPassenger5Minute <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller
|
||||
.progressTimerDriverWaitPassenger5Minute
|
||||
.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
controller
|
||||
.stringRemainingTimeDriverWaitPassenger5Minute,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Please go to Car now '.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const RideBeginPassenger();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/info.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
@@ -24,7 +23,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
Get.put(CaptainWalletController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
// Get.put(MapPassengerController());
|
||||
return MyScafolld(
|
||||
title: 'Driver Wallet'.tr,
|
||||
body: [
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/functions/launch.dart';
|
||||
import '../../../controller/home/profile/order_history_controller.dart';
|
||||
|
||||
class OrderHistory extends StatelessWidget {
|
||||
const OrderHistory({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Instantiate the OrderHistoryController class
|
||||
Get.put(OrderHistoryController());
|
||||
|
||||
return MyScafolld(
|
||||
title: 'Order History'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
GetBuilder<OrderHistoryController>(
|
||||
builder: (orderHistoryController) => orderHistoryController.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: orderHistoryController.orderHistoryListPassenger.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
'No trip yet found'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: orderHistoryController
|
||||
.orderHistoryListPassenger.length,
|
||||
itemBuilder: (BuildContext context, int 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: 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(
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: Get.find<
|
||||
MapPassengerController>()
|
||||
.passengerLocation, // Assuming passenger location is available
|
||||
zoom: 15,
|
||||
),
|
||||
zoomControlsEnabled: true,
|
||||
liteModeEnabled: true,
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
consumeTapEvents: true,
|
||||
geodesic: true,
|
||||
endCap: Cap.buttCap,
|
||||
startCap: Cap.buttCap,
|
||||
visible: true,
|
||||
polylineId:
|
||||
const PolylineId('route'),
|
||||
points: [
|
||||
LatLng(
|
||||
double.parse(
|
||||
rides['start_location']
|
||||
.toString()
|
||||
.split(',')[0]),
|
||||
double.parse(
|
||||
rides['start_location']
|
||||
.toString()
|
||||
.split(',')[1]),
|
||||
),
|
||||
LatLng(
|
||||
double.parse(
|
||||
rides['end_location']
|
||||
.toString()
|
||||
.split(',')[0]),
|
||||
double.parse(
|
||||
rides['end_location']
|
||||
.toString()
|
||||
.split(',')[1]),
|
||||
)
|
||||
],
|
||||
color: AppColor.primaryColor,
|
||||
width: 5,
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:SEFER/views/auth/login_page.dart';
|
||||
import 'package:SEFER/views/auth/captin/login_captin.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -379,7 +379,7 @@ class CountryPicker extends StatelessWidget {
|
||||
BoxName.countryCode, //
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
||||
Get.off(LoginPage());
|
||||
Get.off(LoginCaptin());
|
||||
},
|
||||
)
|
||||
],
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../controller/local/local_controller.dart';
|
||||
import '../auth/login_page.dart';
|
||||
import '../home/map_page_passenger.dart';
|
||||
|
||||
class Language extends StatelessWidget {
|
||||
const Language({Key? key}) : super(key: key);
|
||||
@@ -30,27 +29,21 @@ class Language extends StatelessWidget {
|
||||
title: 'Ar',
|
||||
onPressed: () {
|
||||
controller.changeLang("ar");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPagePassenger())
|
||||
: Get.offAll(() => LoginPage());
|
||||
Get.offAll(() => const MyApp());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "En",
|
||||
onPressed: () {
|
||||
controller.changeLang("en");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPagePassenger())
|
||||
: Get.offAll(() => LoginPage());
|
||||
Get.offAll(() => const MyApp());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Tr",
|
||||
onPressed: () {
|
||||
controller.changeLang("tr");
|
||||
box.read(BoxName.email) != null
|
||||
? Get.offAll(() => const MapPagePassenger())
|
||||
: Get.offAll(() => LoginPage());
|
||||
Get.offAll(() => const MyApp());
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user