6/8/1
This commit is contained in:
@@ -1,31 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AppColor {
|
class AppColor {
|
||||||
static const Color primaryColor = Colors.black; // Slightly softer red
|
static const Color primaryColor = Color(0xFF1DA1F2);
|
||||||
static const Color secondaryColor = Color.fromARGB(255, 255, 255, 255);
|
static const Color writeColor = Color(0xFF333333);
|
||||||
static const Color accentColor =
|
static const Color secondaryColor = Colors.white;
|
||||||
Color.fromARGB(255, 231, 84, 84); // Google Green
|
static const Color accentColor = Colors.grey;
|
||||||
static const Color backgroundColor =
|
static const Color twitterColor = Color(0xFF1DA1F2); // Twitter blue
|
||||||
Color(0xFFF5F5F5); // Light grey background
|
|
||||||
static const Color redColor = Color(0xFFEA4335); // Google Red
|
static const Color redColor = Color(0xFFEA4335); // Google Red
|
||||||
static const Color greenColor = Color(0xFF34A853); // Google Green
|
static const Color greenColor = Color(0xFF34A853); // Google Green
|
||||||
static const Color blueColor = Color(0xFF4285F4); // Google Blue
|
static const Color blueColor = Color(0xFF1DA1F2); // Google Blue
|
||||||
static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow
|
static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow
|
||||||
static Color deepPurpleAccent =
|
static Color deepPurpleAccent =
|
||||||
const Color.fromARGB(255, 123, 76, 254).withOpacity(0.3);
|
const Color.fromARGB(255, 123, 76, 254).withOpacity(0.3);
|
||||||
static const Color greyColor =
|
|
||||||
Color(0xFF9E9E9E); // Light grey for text and dividers
|
|
||||||
static const Color darkGreyColor =
|
|
||||||
Color(0xFF333333); // Dark grey for headings
|
|
||||||
|
|
||||||
// For dynamic elements like gradients
|
|
||||||
static List<Color> gradientStartEnd = [
|
|
||||||
const Color(0xFFD81F26), // Start with primary color
|
|
||||||
const Color(0xFFEF5350), // End with a slightly darker shade
|
|
||||||
];
|
|
||||||
|
|
||||||
static List<Color> secondaryGradientStartEnd = [
|
|
||||||
const Color(0xFF34A853), // Start with green
|
|
||||||
const Color(0xFF4CAF50), // End with a slightly darker shade of green
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,28 +15,28 @@ class AppStyle {
|
|||||||
static TextStyle headTitle2 = TextStyle(
|
static TextStyle headTitle2 = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.writeColor,
|
||||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||||
? 'mohanad'
|
? 'mohanad'
|
||||||
: GoogleFonts.josefinSans().fontFamily);
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle title = TextStyle(
|
static TextStyle title = TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
|
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.writeColor,
|
||||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||||
? 'mohanad'
|
? 'mohanad'
|
||||||
: GoogleFonts.josefinSans().fontFamily);
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle subtitle = TextStyle(
|
static TextStyle subtitle = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.writeColor,
|
||||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||||
? 'mohanad'
|
? 'mohanad'
|
||||||
: GoogleFonts.josefinSans().fontFamily);
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle number = const TextStyle(
|
static TextStyle number = const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.writeColor,
|
||||||
fontFamily: 'digit');
|
fontFamily: 'digit');
|
||||||
|
|
||||||
static BoxDecoration boxDecoration = const BoxDecoration(
|
static BoxDecoration boxDecoration = const BoxDecoration(
|
||||||
@@ -44,7 +44,7 @@ class AppStyle {
|
|||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor, blurRadius: 5, offset: Offset(2, 4)),
|
color: AppColor.accentColor, blurRadius: 5, offset: Offset(2, 4)),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor, blurRadius: 5, offset: Offset(-2, -2))
|
color: AppColor.twitterColor, blurRadius: 5, offset: Offset(-2, -2))
|
||||||
],
|
],
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
@@ -55,7 +55,7 @@ class AppStyle {
|
|||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor, blurRadius: 5, offset: Offset(2, 4)),
|
color: AppColor.accentColor, blurRadius: 5, offset: Offset(2, 4)),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor, blurRadius: 5, offset: Offset(-2, -2))
|
color: AppColor.twitterColor, blurRadius: 5, offset: Offset(-2, -2))
|
||||||
],
|
],
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
|
|||||||
@@ -307,7 +307,9 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
return Get.defaultDialog(
|
return Get.defaultDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
title: 'Hi ,I Arrive your site'.tr,
|
title: 'Hi ,I Arrive your site'.tr,
|
||||||
|
titleStyle: AppStyle.title,
|
||||||
middleText: 'Please go to Car Driver'.tr,
|
middleText: 'Please go to Car Driver'.tr,
|
||||||
|
middleTextStyle: AppStyle.title,
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
title: 'Ok I will go now.'.tr,
|
title: 'Ok I will go now.'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class AudioRecorderController extends GetxController {
|
|||||||
final directory = await getApplicationDocumentsDirectory();
|
final directory = await getApplicationDocumentsDirectory();
|
||||||
// Generate a unique file name using the current timestamp
|
// Generate a unique file name using the current timestamp
|
||||||
String fileName =
|
String fileName =
|
||||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find<MapPassengerController>().rideId}.m4a';
|
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find<MapPassengerController>().rideId}.aac';
|
||||||
filePath = '${directory.path}/$fileName';
|
filePath = '${directory.path}/$fileName';
|
||||||
|
|
||||||
// Define the configuration for the recording
|
// Define the configuration for the recording
|
||||||
|
|||||||
@@ -2623,9 +2623,10 @@ class MapPassengerController extends GetxController {
|
|||||||
if (jsonDecode(res)['message']['rating'] == null) {
|
if (jsonDecode(res)['message']['rating'] == null) {
|
||||||
passengerRate = 5;
|
passengerRate = 5;
|
||||||
} else {
|
} else {
|
||||||
passengerRate =
|
passengerRate = jsonDecode(res)['message']['rating'];
|
||||||
double.parse(jsonDecode(res)['message']['rating'].toString());
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
passengerRate = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ class MyTranslation extends Translations {
|
|||||||
@override
|
@override
|
||||||
Map<String, Map<String, String>> get keys => {
|
Map<String, Map<String, String>> get keys => {
|
||||||
"ar": {
|
"ar": {
|
||||||
|
"Notifications": "إشعارات",
|
||||||
|
'💳 Pay with Credit Card': "ادفع باستخدام بطاقة الائتمان💳",
|
||||||
|
"⚠️ You need to choose an amount!": "⚠️ يجب عليك اختيار مبلغ!",
|
||||||
|
'💰 Pay with Wallet': "ادفع باستخدام المحفظة",
|
||||||
"You must restart the app to change the language.":
|
"You must restart the app to change the language.":
|
||||||
"يجب إعادة تشغيل التطبيق لتغيير اللغة",
|
"يجب إعادة تشغيل التطبيق لتغيير اللغة",
|
||||||
"joined": "انضم",
|
"joined": "انضم",
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ GetBuilder<MapPassengerController> cancelRidePage() {
|
|||||||
reasons[index].toString(),
|
reasons[index].toString(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(reasons[index])),
|
child: Text(
|
||||||
|
reasons[index],
|
||||||
|
style: AppStyle.title,
|
||||||
|
)),
|
||||||
leading: Radio(
|
leading: Radio(
|
||||||
value: index,
|
value: index,
|
||||||
groupValue: controller.selectedReason,
|
groupValue: controller.selectedReason,
|
||||||
|
|||||||
@@ -90,22 +90,28 @@ class CardSeferWallet extends StatelessWidget {
|
|||||||
width: Get.width * .85,
|
width: Get.width * .85,
|
||||||
height: Get.height * .3,
|
height: Get.height * .3,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.deepPurpleAccent,
|
color: AppColor.twitterColor.withOpacity(.8),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(colors: [
|
||||||
colors: [AppColor.blueColor, AppColor.primaryColor]),
|
AppColor.redColor,
|
||||||
|
AppColor.yellowColor,
|
||||||
|
AppColor.yellowColor,
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(8.0),
|
||||||
Text(
|
child: Row(
|
||||||
'${AppInformation.appName} Wallet',
|
children: [
|
||||||
style: AppStyle.headTitle
|
Text(
|
||||||
.copyWith(color: AppColor.primaryColor),
|
'${AppInformation.appName} Wallet',
|
||||||
)
|
style: AppStyle.headTitle
|
||||||
],
|
.copyWith(color: AppColor.writeColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -117,14 +123,17 @@ class CardSeferWallet extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
padding: const EdgeInsets.all(8.0),
|
||||||
children: [
|
child: Row(
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
box.read(BoxName.name),
|
children: [
|
||||||
style: AppStyle.title,
|
Text(
|
||||||
)
|
box.read(BoxName.name),
|
||||||
],
|
style: AppStyle.title,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -146,20 +146,22 @@ class PassengerWalletDialoge extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
MyElevatedButton(
|
box.read(BoxName.countryCode) == 'Egypt'
|
||||||
kolor: AppColor.blueColor,
|
? const SizedBox()
|
||||||
title: '${'Pay with Your'.tr} PayPal',
|
: MyElevatedButton(
|
||||||
onPressed: () {
|
kolor: AppColor.blueColor,
|
||||||
if (controller.selectedAmount != 0) {
|
title: '${'Pay with Your'.tr} PayPal',
|
||||||
controller.makePaymentPayPal(context);
|
onPressed: () {
|
||||||
} else {
|
if (controller.selectedAmount != 0) {
|
||||||
Toast.show(
|
controller.makePaymentPayPal(context);
|
||||||
context,
|
} else {
|
||||||
'You will choose one of above !'.tr,
|
Toast.show(
|
||||||
AppColor.redColor);
|
context,
|
||||||
}
|
'You will choose one of above !'.tr,
|
||||||
},
|
AppColor.redColor);
|
||||||
),
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
box.read(BoxName.countryCode) == 'Egypt'
|
box.read(BoxName.countryCode) == 'Egypt'
|
||||||
? Column(
|
? Column(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -36,19 +36,22 @@ class PaymentHistoryPassengerPage extends StatelessWidget {
|
|||||||
color: double.parse(list['balance']) < 0
|
color: double.parse(list['balance']) < 0
|
||||||
? AppColor.redColor.withOpacity(.4)
|
? AppColor.redColor.withOpacity(.4)
|
||||||
: AppColor.greenColor.withOpacity(.4)),
|
: AppColor.greenColor.withOpacity(.4)),
|
||||||
child: Row(
|
child: Padding(
|
||||||
mainAxisAlignment:
|
padding: const EdgeInsets.all(8.0),
|
||||||
MainAxisAlignment.spaceBetween,
|
child: Row(
|
||||||
children: [
|
mainAxisAlignment:
|
||||||
Text(
|
MainAxisAlignment.spaceBetween,
|
||||||
list['balance'],
|
children: [
|
||||||
style: AppStyle.title,
|
Text(
|
||||||
),
|
list['balance'],
|
||||||
Text(
|
style: AppStyle.title,
|
||||||
list['created_at'],
|
),
|
||||||
style: AppStyle.title,
|
Text(
|
||||||
),
|
list['created_at'],
|
||||||
],
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,115 +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/payment/captain_wallet_controller.dart';
|
|
||||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
|
||||||
|
|
||||||
import '../../../constant/box_name.dart';
|
|
||||||
import '../../../main.dart';
|
|
||||||
import '../../widgets/elevated_btn.dart';
|
|
||||||
|
|
||||||
class PointsCaptain extends StatelessWidget {
|
|
||||||
PaymentController paymentController = Get.put(PaymentController());
|
|
||||||
CaptainWalletController captainWalletController =
|
|
||||||
Get.put(CaptainWalletController());
|
|
||||||
|
|
||||||
PointsCaptain({
|
|
||||||
super.key,
|
|
||||||
required this.kolor,
|
|
||||||
required this.countPoint,
|
|
||||||
required this.pricePoint,
|
|
||||||
});
|
|
||||||
final Color kolor;
|
|
||||||
final String countPoint;
|
|
||||||
double pricePoint;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
box.read(BoxName.countryCode) == 'Egypt'
|
|
||||||
? Get.defaultDialog(
|
|
||||||
title: 'Which method you will pay'.tr,
|
|
||||||
titleStyle: AppStyle.title,
|
|
||||||
content: Column(
|
|
||||||
children: [
|
|
||||||
MyElevatedButton(
|
|
||||||
title: '💳 Pay with Credit Card'.tr,
|
|
||||||
onPressed: () async {
|
|
||||||
Get.back();
|
|
||||||
await paymentController.payWithPayMob(
|
|
||||||
context,
|
|
||||||
pricePoint.toStringAsFixed(2),
|
|
||||||
box.read(BoxName.countryCode) == 'Egypt'
|
|
||||||
? 'EGP'
|
|
||||||
: 'JOD', () async {
|
|
||||||
await captainWalletController.addDriverPayment(
|
|
||||||
'visa', pricePoint);
|
|
||||||
await captainWalletController.addDriverWallet(
|
|
||||||
'visa', countPoint);
|
|
||||||
// await captainWalletController
|
|
||||||
// .getCaptainWalletFromBuyPoints();
|
|
||||||
});
|
|
||||||
}, //51524
|
|
||||||
),
|
|
||||||
// Add some spacing between buttons
|
|
||||||
MyElevatedButton(
|
|
||||||
kolor: AppColor.yellowColor,
|
|
||||||
title: '💰 Pay with Wallet'.tr,
|
|
||||||
onPressed: () async {
|
|
||||||
Get.back();
|
|
||||||
await paymentController.payWithPayMobWallet(
|
|
||||||
context,
|
|
||||||
pricePoint.toStringAsFixed(2),
|
|
||||||
box.read(BoxName.countryCode) == 'Egypt'
|
|
||||||
? 'EGP'
|
|
||||||
: 'JOD', () async {
|
|
||||||
await captainWalletController.addDriverPayment(
|
|
||||||
'visa', pricePoint);
|
|
||||||
await captainWalletController.addDriverWallet(
|
|
||||||
'visa', countPoint);
|
|
||||||
// await captainWalletController
|
|
||||||
// .getCaptainWalletFromBuyPoints();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
))
|
|
||||||
: await paymentController.makePaymentStripe(pricePoint,
|
|
||||||
box.read(BoxName.countryCode) == 'Jordan' ? 'jod' : 'egp',
|
|
||||||
() async {
|
|
||||||
await captainWalletController.addDriverPayment(
|
|
||||||
'visa', pricePoint);
|
|
||||||
await captainWalletController.addDriverWallet(
|
|
||||||
'visa', countPoint);
|
|
||||||
// await captainWalletController.getCaptainWalletFromBuyPoints();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
width: Get.width * .22,
|
|
||||||
height: Get.width * .15,
|
|
||||||
margin: const EdgeInsets.all(4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: kolor,
|
|
||||||
border: Border.all(color: AppColor.accentColor),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'$countPoint ${'Point'.tr}',
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,463 +0,0 @@
|
|||||||
import 'package:SEFER/controller/functions/tts.dart';
|
|
||||||
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
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';
|
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
|
||||||
import 'package:path/path.dart';
|
|
||||||
|
|
||||||
import '../../widgets/my_scafold.dart';
|
|
||||||
import 'points_captain.dart';
|
|
||||||
|
|
||||||
class WalletCaptain extends StatelessWidget {
|
|
||||||
WalletCaptain({super.key});
|
|
||||||
CaptainWalletController captainWalletController =
|
|
||||||
Get.put(CaptainWalletController());
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
Get.put(MapPassengerController());
|
|
||||||
return MyScafolld(
|
|
||||||
title: 'Driver Wallet'.tr,
|
|
||||||
body: [
|
|
||||||
GetBuilder<CaptainWalletController>(
|
|
||||||
builder: (captainWalletController) => captainWalletController
|
|
||||||
.isLoading
|
|
||||||
? const MyCircularProgressIndicator()
|
|
||||||
: Padding(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: ListView(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
const SizedBox(),
|
|
||||||
Container(
|
|
||||||
decoration: AppStyle.boxDecoration.copyWith(
|
|
||||||
color: double.parse(captainWalletController
|
|
||||||
.totalPoints) <
|
|
||||||
0 &&
|
|
||||||
double.parse(captainWalletController
|
|
||||||
.totalPoints) >
|
|
||||||
-300
|
|
||||||
? AppColor.yellowColor
|
|
||||||
: double.parse(captainWalletController
|
|
||||||
.totalPoints) <
|
|
||||||
-300
|
|
||||||
? AppColor.redColor
|
|
||||||
: AppColor.greenColor,
|
|
||||||
),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
Get.snackbar(
|
|
||||||
'the 300 points equal 300 L.E'.tr,
|
|
||||||
'the 300 points equal 300 L.E for you \nSo go and gain your money'
|
|
||||||
.tr,
|
|
||||||
backgroundColor: AppColor.greenColor,
|
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
|
||||||
duration: const Duration(seconds: 4),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 4),
|
|
||||||
child: Text(
|
|
||||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
|
||||||
style: AppStyle.headTitle2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
double.parse(captainWalletController.totalPoints
|
|
||||||
.toString()) <
|
|
||||||
-300
|
|
||||||
? MyElevatedButton(
|
|
||||||
title: 'Charge your Account'.tr,
|
|
||||||
onPressed: () {})
|
|
||||||
: const SizedBox(),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
const CardSeferWalletDriver(),
|
|
||||||
Card(
|
|
||||||
elevation: 4,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Total Budget from trips is '.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
width: 2,
|
|
||||||
color: AppColor.redColor)),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.snackbar(
|
|
||||||
icon: InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
await Get.find<
|
|
||||||
TextToSpeechController>()
|
|
||||||
.speakText(
|
|
||||||
'This amount for all trip I get from Passengers'
|
|
||||||
.tr);
|
|
||||||
},
|
|
||||||
child: const Icon(
|
|
||||||
Icons.headphones)),
|
|
||||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmount}\$',
|
|
||||||
'This amount for all trip I get from Passengers'
|
|
||||||
.tr,
|
|
||||||
duration:
|
|
||||||
const Duration(seconds: 6),
|
|
||||||
backgroundColor:
|
|
||||||
AppColor.yellowColor,
|
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(2),
|
|
||||||
child: Text(
|
|
||||||
'${captainWalletController.totalAmount}\$'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Total Budget from trips by\nCredit card is '
|
|
||||||
.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
width: 2,
|
|
||||||
color: AppColor.greenColor)),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(2),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
Get.snackbar(
|
|
||||||
icon: InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
await Get.find<
|
|
||||||
TextToSpeechController>()
|
|
||||||
.speakText(
|
|
||||||
'This amount for all trip I get from Passengers and Collected For me in'
|
|
||||||
.tr +
|
|
||||||
' SAFAR Wallet'.tr,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: const Icon(
|
|
||||||
Icons.headphones),
|
|
||||||
),
|
|
||||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmountVisa}\$',
|
|
||||||
'This amount for all trip I get from Passengers and Collected For me in'
|
|
||||||
.tr +
|
|
||||||
' ${AppInformation.appName} Wallet'
|
|
||||||
.tr,
|
|
||||||
duration:
|
|
||||||
const Duration(seconds: 6),
|
|
||||||
backgroundColor:
|
|
||||||
AppColor.redColor,
|
|
||||||
snackPosition:
|
|
||||||
SnackPosition.BOTTOM,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'${captainWalletController.totalAmountVisa}\$'),
|
|
||||||
),
|
|
||||||
))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
MyElevatedButton(
|
|
||||||
title:
|
|
||||||
'You can buy points from your budget'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'Pay from my budget'.tr,
|
|
||||||
titleStyle: AppStyle.title,
|
|
||||||
content: Form(
|
|
||||||
key: captainWalletController.formKey,
|
|
||||||
child: MyTextForm(
|
|
||||||
controller: captainWalletController
|
|
||||||
.amountFromBudgetController,
|
|
||||||
label:
|
|
||||||
'${'You have in account'.tr} ${captainWalletController.totalAmountVisa}',
|
|
||||||
hint:
|
|
||||||
'${'You have in account'.tr} ${captainWalletController.totalAmountVisa}',
|
|
||||||
type: TextInputType.number,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Pay',
|
|
||||||
onPressed: () async {
|
|
||||||
if (double.parse(
|
|
||||||
captainWalletController
|
|
||||||
.amountFromBudgetController
|
|
||||||
.text) <
|
|
||||||
double.parse(
|
|
||||||
captainWalletController
|
|
||||||
.totalAmountVisa)) {
|
|
||||||
await captainWalletController
|
|
||||||
.payFromBudget();
|
|
||||||
} else {
|
|
||||||
Get.back();
|
|
||||||
Get.snackbar(
|
|
||||||
'Your Budget less than needed'
|
|
||||||
.tr,
|
|
||||||
'',
|
|
||||||
duration: const Duration(
|
|
||||||
seconds: 3),
|
|
||||||
backgroundColor:
|
|
||||||
AppColor.redColor,
|
|
||||||
snackPosition:
|
|
||||||
SnackPosition.BOTTOM,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
cancel: MyElevatedButton(
|
|
||||||
title: 'Cancel'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: AppStyle.boxDecoration,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'You can buy Points to let you online\nby this list below'
|
|
||||||
.tr,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
const Divider(
|
|
||||||
indent: 30,
|
|
||||||
endIndent: 30,
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
thickness: 3,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: AppStyle.boxDecoration,
|
|
||||||
height: Get.height * .1,
|
|
||||||
child: ListView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
children: [
|
|
||||||
PointsCaptain(
|
|
||||||
kolor: AppColor.blueColor,
|
|
||||||
pricePoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? 5
|
|
||||||
: 100,
|
|
||||||
countPoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? '300'
|
|
||||||
: '100',
|
|
||||||
),
|
|
||||||
PointsCaptain(
|
|
||||||
kolor: Colors.green,
|
|
||||||
pricePoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? 10
|
|
||||||
: 200,
|
|
||||||
countPoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? '1040'
|
|
||||||
: '210',
|
|
||||||
),
|
|
||||||
PointsCaptain(
|
|
||||||
kolor: Colors.amberAccent,
|
|
||||||
pricePoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? 22
|
|
||||||
: 400,
|
|
||||||
countPoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? '2300'
|
|
||||||
: '450',
|
|
||||||
),
|
|
||||||
PointsCaptain(
|
|
||||||
kolor: AppColor.yellowColor,
|
|
||||||
pricePoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? 50
|
|
||||||
: 1000,
|
|
||||||
countPoint:
|
|
||||||
box.read(BoxName.countryCode) ==
|
|
||||||
'Jordan'
|
|
||||||
? '55000'
|
|
||||||
: '1200',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
box
|
|
||||||
.read(BoxName.accountIdStripeConnect)
|
|
||||||
.toString()
|
|
||||||
.isEmpty
|
|
||||||
? Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
MyElevatedButton(
|
|
||||||
title:
|
|
||||||
'Create Wallet to receive your money',
|
|
||||||
onPressed: () async {
|
|
||||||
PaymentController paymentController =
|
|
||||||
Get.find<PaymentController>();
|
|
||||||
paymentController
|
|
||||||
.createConnectAccount();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
MyElevatedButton(
|
|
||||||
kolor: AppColor.blueColor,
|
|
||||||
title: 'Payment History'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.to(() => const PaymentHistoryDriverPage(),
|
|
||||||
transition: Transition.size);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () async {
|
|
||||||
// PaymentController paymentController =
|
|
||||||
// Get.put(PaymentController());
|
|
||||||
// await paymentController.createTransactionToCaptain(
|
|
||||||
// '1000',
|
|
||||||
// box.read(BoxName.accountIdStripeConnect));
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// "Pay to Captain",
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))
|
|
||||||
],
|
|
||||||
isleading: true,
|
|
||||||
action: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// captainWalletController.getCaptainWalletFromBuyPoints();
|
|
||||||
},
|
|
||||||
child: const Icon(Icons.refresh)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CardSeferWalletDriver extends StatelessWidget {
|
|
||||||
const CardSeferWalletDriver({
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: Get.width * .85,
|
|
||||||
height: Get.height * .25,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.deepPurpleAccent,
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
|
||||||
gradient: const LinearGradient(
|
|
||||||
colors: [AppColor.blueColor, AppColor.primaryColor]),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${AppInformation.appName} Wallet',
|
|
||||||
style: AppStyle.headTitle
|
|
||||||
.copyWith(color: AppColor.primaryColor),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${Get.find<CaptainWalletController>().totalAmountVisa}\$' ??
|
|
||||||
'0.0 \$',
|
|
||||||
style: AppStyle.headTitle2,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
box.read(BoxName.nameDriver),
|
|
||||||
style: AppStyle.title,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -63,13 +63,39 @@ class OrderHistory extends StatelessWidget {
|
|||||||
width: Get.width * .75,
|
width: Get.width * .75,
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
target: Get.find<
|
target: LatLng(
|
||||||
MapPassengerController>()
|
(double.parse(
|
||||||
.passengerLocation, // Assuming passenger location is available
|
rides['start_location']
|
||||||
zoom: 15,
|
.toString()
|
||||||
|
.split(',')[0]) +
|
||||||
|
double.parse(
|
||||||
|
rides['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[0])) /
|
||||||
|
2,
|
||||||
|
(double.parse(
|
||||||
|
rides['start_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1]) +
|
||||||
|
double.parse(
|
||||||
|
rides['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1])) /
|
||||||
|
2,
|
||||||
|
),
|
||||||
|
zoom: 12,
|
||||||
),
|
),
|
||||||
|
// bounds: LatLngBounds(
|
||||||
|
// northeast: LatLng(
|
||||||
|
// double.parse(rides['end_location'].toString().split(',')[0]),
|
||||||
|
// double.parse(rides['end_location'].toString().split(',')[1]),
|
||||||
|
// ),
|
||||||
|
// southwest: LatLng(
|
||||||
|
// double.parse(rides['start_location'].toString().split(',')[0]),
|
||||||
|
// double.parse(rides['start_location'].toString().split(',')[1]),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
zoomControlsEnabled: true,
|
zoomControlsEnabled: true,
|
||||||
// liteModeEnabled: false,
|
|
||||||
polylines: {
|
polylines: {
|
||||||
Polyline(
|
Polyline(
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -106,6 +132,7 @@ class OrderHistory extends StatelessWidget {
|
|||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
mapType: MapType.normal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@@ -122,12 +149,17 @@ class OrderHistory extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
rides['status'],
|
rides['status'],
|
||||||
style: rides['status'] !=
|
style: rides['status'] ==
|
||||||
'Canceled'.tr
|
'Canceled'.tr
|
||||||
? AppStyle.subtitle.copyWith(
|
? AppStyle.subtitle.copyWith(
|
||||||
color: AppColor.greenColor)
|
color: AppColor.redColor)
|
||||||
: AppStyle.subtitle.copyWith(
|
: rides['status'] == 'Finished'.tr
|
||||||
color: AppColor.redColor),
|
? AppStyle.subtitle.copyWith(
|
||||||
|
color:
|
||||||
|
AppColor.greenColor)
|
||||||
|
: AppStyle.subtitle.copyWith(
|
||||||
|
color:
|
||||||
|
AppColor.yellowColor),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${'Price is'.tr} ${rides['price']}',
|
'${'Price is'.tr} ${rides['price']}',
|
||||||
|
|||||||
Reference in New Issue
Block a user