25-3/18/1
This commit is contained in:
0
lib/views/home/my_wallet/bank_account_egypt.dart
Normal file → Executable file
0
lib/views/home/my_wallet/bank_account_egypt.dart
Normal file → Executable file
3
lib/views/home/my_wallet/card_wallet_widget.dart
Normal file → Executable file
3
lib/views/home/my_wallet/card_wallet_widget.dart
Normal file → Executable file
@@ -183,8 +183,7 @@ class CardSeferWalletDriver extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'${Get.find<CaptainWalletController>().totalAmountVisa} ${'L.E'.tr}' ??
|
||||
'0.0 ${'L.E'.tr}',
|
||||
'${Get.find<CaptainWalletController>().totalAmountVisa} ${'L.E'.tr}',
|
||||
style: AppStyle.headTitle2.copyWith(
|
||||
color: AppColor.writeColor, fontSize: 28),
|
||||
),
|
||||
|
||||
0
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file → Executable file
0
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file → Executable file
0
lib/views/home/my_wallet/points_captain.dart
Normal file → Executable file
0
lib/views/home/my_wallet/points_captain.dart
Normal file → Executable file
0
lib/views/home/my_wallet/transfer_budget_page.dart
Normal file → Executable file
0
lib/views/home/my_wallet/transfer_budget_page.dart
Normal file → Executable file
70
lib/views/home/my_wallet/walet_captain.dart
Normal file → Executable file
70
lib/views/home/my_wallet/walet_captain.dart
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:sefer_driver/constant/links.dart';
|
||||
import 'package:sefer_driver/controller/functions/crud.dart';
|
||||
import 'package:sefer_driver/controller/functions/tts.dart';
|
||||
@@ -382,13 +383,38 @@ class WalletCaptain extends StatelessWidget {
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Pay'.tr,
|
||||
onPressed: () async {
|
||||
if (double.parse(controller.amountFromBudgetController.text) <
|
||||
double.parse(controller.totalAmountVisa)) {
|
||||
await controller.payFromBudget();
|
||||
} else {
|
||||
Get.back();
|
||||
bool isAvailable =
|
||||
await LocalAuthentication().isDeviceSupported();
|
||||
if (isAvailable) {
|
||||
// Authenticate the user
|
||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
localizedReason:
|
||||
'Use Touch ID or Face ID to confirm payment',
|
||||
options: AuthenticationOptions(
|
||||
biometricOnly: true,
|
||||
sensitiveTransaction: true,
|
||||
));
|
||||
if (didAuthenticate) {
|
||||
if (double.parse(controller.amountFromBudgetController.text) <
|
||||
double.parse(controller.totalAmountVisa)) {
|
||||
await controller.payFromBudget();
|
||||
} else {
|
||||
Get.back();
|
||||
|
||||
mySnackeBarError('Your Budget less than needed'.tr);
|
||||
mySnackeBarError('Your Budget less than needed'.tr);
|
||||
}
|
||||
} else {
|
||||
// Authentication failed, handle accordingly
|
||||
MyDialog().getDialog('Authentication failed'.tr, ''.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
MyDialog().getDialog('Biometric Authentication'.tr,
|
||||
'You should use Touch ID or Face ID to confirm payment'.tr,
|
||||
() {
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -406,12 +432,34 @@ class WalletCaptain extends StatelessWidget {
|
||||
Widget _buildTransferBudgetButton(CaptainWalletController controller) {
|
||||
return MyElevatedButton(
|
||||
title: 'Transfer budget'.tr,
|
||||
onPressed: () {
|
||||
if (double.parse(controller.totalAmountVisa) > 15) {
|
||||
Get.to(() => const TransferBudgetPage());
|
||||
onPressed: () async {
|
||||
bool isAvailable = await LocalAuthentication().isDeviceSupported();
|
||||
if (isAvailable) {
|
||||
// Authenticate the user
|
||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
localizedReason: 'Use Touch ID or Face ID to confirm payment',
|
||||
options: AuthenticationOptions(
|
||||
biometricOnly: true,
|
||||
sensitiveTransaction: true,
|
||||
));
|
||||
if (didAuthenticate) {
|
||||
if (double.parse(controller.totalAmountVisa) > 15) {
|
||||
Get.to(() => const TransferBudgetPage());
|
||||
} else {
|
||||
mySnackeBarError(
|
||||
"You don't have enough money in your SEFER wallet".tr);
|
||||
}
|
||||
} else {
|
||||
// Authentication failed, handle accordingly
|
||||
MyDialog().getDialog('Authentication failed'.tr, ''.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError(
|
||||
"You don't have enough money in your SEFER wallet".tr);
|
||||
MyDialog().getDialog('Biometric Authentication'.tr,
|
||||
'You should use Touch ID or Face ID to confirm payment'.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
0
lib/views/home/my_wallet/weekly_payment_page.dart
Normal file → Executable file
0
lib/views/home/my_wallet/weekly_payment_page.dart
Normal file → Executable file
Reference in New Issue
Block a user