6/1/1
This commit is contained in:
@@ -93,56 +93,61 @@ class RatePassenger extends StatelessWidget {
|
||||
],
|
||||
)),
|
||||
),
|
||||
controller.ispassengerWantWalletFromDriver
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"How much Passenger pay?".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller:
|
||||
controller.passenggerPayAmount,
|
||||
label: "passenger amount to me".tr,
|
||||
hint: "passenger amount to me".tr,
|
||||
type:
|
||||
const TextInputType.numberWithOptions(
|
||||
decimal: true)),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Press here".tr,
|
||||
onPressed: () {
|
||||
controller.addPassengerWallet();
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: Get.width * .73,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"Would the passenger like to settle the remaining fare using their wallet?"
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Press here".tr,
|
||||
onPressed: () {
|
||||
controller.passengerWantPay();
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
controller.walletChecked != 'true'
|
||||
? GetBuilder<RateController>(builder: (controller) {
|
||||
return controller.ispassengerWantWalletFromDriver
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"How much Passenger pay?".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller:
|
||||
controller.passengerPayAmount,
|
||||
label:
|
||||
"passenger amount to me".tr,
|
||||
hint: "passenger amount to me".tr,
|
||||
type: const TextInputType
|
||||
.numberWithOptions(
|
||||
decimal: true)),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Press here".tr,
|
||||
onPressed: () {
|
||||
controller.addPassengerWallet();
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: Get.width * .73,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"Would the passenger like to settle the remaining fare using their wallet?"
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "Press here".tr,
|
||||
onPressed: () {
|
||||
controller.passengerWantPay();
|
||||
})
|
||||
],
|
||||
),
|
||||
);
|
||||
})
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
@@ -237,7 +237,7 @@ class RideCalculateDriver extends StatelessWidget {
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'${"Total rides on month".tr} = ${durationController.jsonData2['message'][0]['totalCount'].toString()}'
|
||||
'${"Total budgets on month".tr} = ${durationController.jsonData2['message'][0]['totalPrice'].toString()}'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
@@ -246,7 +246,7 @@ class RideCalculateDriver extends StatelessWidget {
|
||||
reservedSize: 30, showTitles: true)),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of rides on days'.tr,
|
||||
'Counts of budgets on days'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
|
||||
@@ -41,7 +41,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
))),
|
||||
IconButton(
|
||||
// onPressed: () => box.remove(BoxName.periods),
|
||||
// onPressed: () => Get.find<OrderRequestController>().getSQL(),
|
||||
onPressed: () => sql.deleteAllData(TableName.driverOrdersRefuse),
|
||||
icon: const Icon(Icons.remove)),
|
||||
// GetBuilder<OrderRequestController>(
|
||||
|
||||
@@ -7,23 +7,22 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
|
||||
import '../../../../../constant/box_name.dart';
|
||||
import '../../../../../controller/functions/call_controller.dart';
|
||||
import '../../../../../main.dart';
|
||||
|
||||
class CallPage extends StatelessWidget {
|
||||
const CallPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(title: 'Call Page', isleading: true, body: [callPage()]);
|
||||
return MyScafolld(
|
||||
title: 'Call Page'.tr, isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
Get.put(MapDriverController());
|
||||
callController.initAgoraFull();
|
||||
// callController.join();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
@@ -35,19 +34,6 @@ GetBuilder<HomeCaptainController> callPage() {
|
||||
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(
|
||||
|
||||
@@ -123,12 +123,12 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
controller.hours > 1
|
||||
? '⌚️ ${controller.hours}h ${controller.minutes}m' // Ride Duration with emoji
|
||||
: '⌚️ ${controller.minutes}m', // Short ride duration
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16.0), // Add spacing between sections
|
||||
width: 10.0), // Add spacing between sections
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: Get.width * .22,
|
||||
@@ -136,7 +136,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
' ${controller.distance} km', // Distance with emoji
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -166,11 +166,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Total Cost is '.tr,
|
||||
Text("cost is ".tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.totalPassenger.toString(),
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -181,7 +181,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
width: Get.width * .4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text(controller.carType,
|
||||
child: Text(controller.carType.tr,
|
||||
style: AppStyle.title),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -99,7 +99,7 @@ class SosConnect extends StatelessWidget {
|
||||
} else {
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
'+02${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver
|
||||
'+2${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver
|
||||
"${"Hello this is Driver".tr} ${box.read(BoxName.nameDriver)}.${" My current location is:".tr} https://www.google.com/maps/place/${Get.find<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude}${" \nand I have a trip on".tr} ${AppInformation.appName} ${"App \nwith Passenger ".tr}${mapDriverController.passengerName}");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:SEFER/controller/functions/tts.dart';
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:SEFER/controller/home/payment/paymob_payout.dart';
|
||||
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -433,50 +434,178 @@ class CardSeferWalletDriver extends StatelessWidget {
|
||||
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(
|
||||
GetBuilder<CaptainWalletController>(builder: (captainWalletController) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Do you want to collect your earnings?'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Total wallet is '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
Get.find<CaptainWalletController>().totalAmountVisa,
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Wallet Type'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
MyDropDown(),
|
||||
],
|
||||
),
|
||||
Form(
|
||||
key: captainWalletController.formKey,
|
||||
child: MyTextForm(
|
||||
controller: captainWalletController.issurWallet,
|
||||
label: "Enter your wallet number".tr,
|
||||
hint: "Enter your wallet number".tr,
|
||||
type: TextInputType.phone,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () async {
|
||||
if (captainWalletController.formKey.currentState!
|
||||
.validate()) {
|
||||
if (double.parse(Get.find<CaptainWalletController>()
|
||||
.totalAmountVisa) >
|
||||
100) {
|
||||
Get.back();
|
||||
await Get.put(PaymobPayout()).payToWalletDriverAll(
|
||||
Get.find<CaptainWalletController>().totalAmountVisa,
|
||||
captainWalletController.issurWallet.toString(),
|
||||
captainWalletController.issurWallet.toString(),
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'${'The Amount is less than'.tr}${box.read(BoxName.countryCode) == 'Egypt' ? '100' : '20'}',
|
||||
'',
|
||||
backgroundColor: AppColor.yellowColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'cancel'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
));
|
||||
},
|
||||
child: 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: [
|
||||
Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle.headTitle
|
||||
.copyWith(color: AppColor.primaryColor),
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
box.read(BoxName.nameDriver),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
"Cash Out".tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
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,
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyDropDown extends StatefulWidget {
|
||||
@override
|
||||
_MyDropDownState createState() => _MyDropDownState();
|
||||
}
|
||||
|
||||
class _MyDropDownState extends State<MyDropDown> {
|
||||
String dropdownValue = 'Itsalate';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownButton<String>(
|
||||
value: dropdownValue,
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
elevation: 16,
|
||||
style: const TextStyle(color: Colors.deepPurple),
|
||||
underline: Container(
|
||||
height: 2,
|
||||
color: Colors.deepPurpleAccent,
|
||||
),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
dropdownValue = newValue!;
|
||||
});
|
||||
},
|
||||
items: <String>['Itsalate', 'We', 'Orange', 'Vodafone']
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../controller/payment/driver_payment_controller.dart';
|
||||
|
||||
@@ -27,12 +28,18 @@ class WeeklyPaymentPage extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
controller.weeklyList[0]['totalAmount']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
controller.weeklyList[0]['totalAmount']
|
||||
.toString(),
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -57,28 +64,45 @@ class WeeklyPaymentPage extends StatelessWidget {
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
list['amount'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['dateUpdated'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Card(
|
||||
elevation: 2,
|
||||
color: list['paymentMethod'] == 'visa'
|
||||
? AppColor.blueColor
|
||||
: AppColor.secondaryColor,
|
||||
child: Text(
|
||||
list['paymentMethod'],
|
||||
style: AppStyle.title,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
list['paymentMethod'] == 'Remainder'
|
||||
? 'Remainder'.tr
|
||||
: list['paymentMethod'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Card(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
list['amount'],
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
DateFormat('yyyy-MM-dd hh:mm a')
|
||||
.format(DateTime.parse(
|
||||
list['dateUpdated'])),
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user