Merge pull request 'uncommented the code and resolved errors' (#2) from kyc_API_Implementation into pre_developmnet_branch

Reviewed-on: https://ct.mfsys.com.pk/UCO-Projects/uco-mobile-poc/pulls/2
api_code_uncomment
Waqas Khurshid 2 weeks ago
commit e930896215

@ -19,82 +19,66 @@ class UrlContants {
// static final String encryptedUrl = encryption.encryptData('https://uco.mfsys.ca');
// static final String baseUrl ='';
static final REFRESH_TOKEN = "$baseUrl/refreshtoken";
static final LOGIN = "$baseUrl/security/auth/user/authenticate";
static final LOGIN_OTP = "$baseUrl/security/auth/verifylogin-otp";
static final RESEND_OTP = "$baseUrl/customer/login/otp-send";
static final REGISTER = "$baseUrl/customer/register";
static final VERIFY_ID = "$REGISTER/checkid";
static final VERIFY_ACCOUNT_NO = "$REGISTER/checkaccountno";
static final PIN_VERIFY = "$REGISTER/pin-verify";
static final SET_PASSWORD = "$baseUrl/customer/set-password";
static final ACCOUNT_DETAILS = "$baseUrl/uco/depositAccounts";
static final ACCOUNT_INQUIRY = "$baseUrl/uco/accountInquiry";
static final EXCHANGE_RATE = "$baseUrl/uco/fetchExchangeRate";
static final FETCH_PAYMENT_PURPOSE = "$baseUrl/getPurposes";
static final LOAN_ACCOUNT_DETAILS = "$baseUrl/account/indvdetails";
static final ACCOUNT_TRANSACTIONS = "$baseUrl/uco/accountStatement";
static final LOAN_ACCOUNT_TRANSACTIONS = "$baseUrl/account/loan/history";
static final BENEFICIARY_ACCOUNTS = "$baseUrl/beneficiary";
static final ACTIVITY_DETAILS = "$baseUrl/account/activity";
static final SEND_TRANSACTION_STEP1 = "$baseUrl/uco/sendDrTranOtpAndVerifyTranPin";
static final SEND_TRANSACTION_STEP2 = "$baseUrl/uco/submitDrTransaction";
static final UPLOAD_USER_PROFILE_PICTURE = "$baseUrl/uco/updateCustomerProfile";
static final CREATE_TRANSACTION_PIN_OTP = "$baseUrl/uco/createTransactionPin";
static final CREATE_TRANSACTION_PIN = "$baseUrl/uco/verifyTransactionPin";
static final CHANGE_TRANSACTION_PIN = "$baseUrl/uco/changeTransactionPin";
static final BENEFICIARY_PIN = "$baseUrl/beneficiary";
static final GENERATE_REPORTS = "$baseUrl/uco/generateReport";
static final DELETE_BENEFICIARYT = "$baseUrl/beneficiary";
static final CHANGE_PASSWORD_SEND_OTP = "$baseUrl/security/user/changePassword";
static final CHANGE_PASSWORD = "$baseUrl/customer/change-password";
static final FORGET_PASSWORD_STEP_1 = "$baseUrl/customer/forgetPassword/userid";
static final FORGET_PASSWORD_STEP_2 = "$baseUrl/customer/forgetpassword";
static final FORGET_PASSWORD_STEP_3 = "$baseUrl/customer/register/otp-resend";
static final FORGET_PASSWORD_STEP_4 = "$baseUrl/customer/updatepassword";
static final SIGNUP_STEP_1 = "$baseUrl/security/auth/user/register";
static final SIGNUP_STEP_2 = "$baseUrl/security/auth/verifysignup-otp";
static final SIGNUP_STEP_3 = "$baseUrl/uco/auth/user/authenticate/onboardCustomer";
static final SIGNUP_STEP_4 = "$baseUrl/customer/register/pin-verify";
static final SIGNUP_STEP_4_RESEND_OTP = "$baseUrl/customer/register/pin-resend";
static final SIGNUP_STEP_5 = "$baseUrl/customer/set-password";
static final SEND_FEED_BACK = "$baseUrl/send-email";
static final fetchPendingCredittransaction = "$baseUrl/uco/fetchPendingCredittransaction";
static final ACCEPT_RECEIVE_TRANSACTION = "$baseUrl/uco/submitCrTransaction";
static final REVERSE_TRANSACTION = "$baseUrl/uco/reverseTransaction";
static final FETCH_ACCOUNT_STATEMENT = "$baseUrl/uco/fetchDepositAccountStatement";
static final FETCH_USER_ACTIVITY = "$baseUrl/uco/account/activity/";
static final fetchUcoDepositProducts = "$baseUrl/uco/auth/user/authenticate/onboardCustomer/fetchUcoDepositProducts";
static final FETCH_DEPOSIT_PRODUCTS = "$baseUrl/uco/deposit/fetchUcoDepositProducts";
static final FETCH_GLS_ACCOUNTS = "$baseUrl/uco/deposit/fetchUcoGls";
static final SEND_ADD_MONEY_OTP = SEND_TRANSACTION_STEP1;
static final SEND_ADD_MONEY_TRANSACTION = "$baseUrl/uco/submitGLAccontAddMoneyTranasction";
static final evaluateCurrency = "$baseUrl/uco/getEvaluatedCurrency";
static final ADD_NEW_ACCOUNT = "$baseUrl/uco/createUcoAccount";
static String resendOtp = "$baseUrl/security/auth/resend-otp";
static String resendOtpUSend = "$baseUrl/uco/resendDrTranOtp";
static String resendTransOtp = "$baseUrl/uco/changeTransactionPin";
static String createPinOtp = "$baseUrl/uco/createTransactionPin";
static final ADD_NEW_BENEIFCIARY = "$baseUrl/uco/addBeneficary";
static final DELETE_BENEFICIARY = "$baseUrl/uco/deleteBeneficary";
static final FETCH_ALL_BENEFICIARY = "$baseUrl/uco/getBeneficary";
static final REFRESH_TOKEN = "$baseUrl/refreshtoken";
static String resendTransOtp = "$baseUrl/uco/changeTransactionPin";
static String createPinOtp = "$baseUrl/uco/createTransactionPin";
static final FETCH_DEPOSIT_PRODUCTS = "$baseUrl/uco/deposit/fetchUcoDepositProducts";
static final SIGNUP_STEP_4 = "$baseUrl/customer/register/pin-verify";
static final SIGNUP_STEP_4_RESEND_OTP = "$baseUrl/customer/register/pin-resend";
static final SIGNUP_STEP_5 = "$baseUrl/customer/set-password";
static final SEND_FEED_BACK = "$baseUrl/send-email";
static final DELETE_BENEFICIARYT = "$baseUrl/beneficiary";
static final CHANGE_PASSWORD = "$baseUrl/customer/change-password";
static final FORGET_PASSWORD_STEP_1 = "$baseUrl/customer/forgetPassword/userid";
static final FORGET_PASSWORD_STEP_2 = "$baseUrl/customer/forgetpassword";
static final FORGET_PASSWORD_STEP_3 = "$baseUrl/customer/register/otp-resend";
static final FORGET_PASSWORD_STEP_4 = "$baseUrl/customer/updatepassword";
static final GENERATE_REPORTS = "$baseUrl/uco/generateReport";
static final BENEFICIARY_PIN = "$baseUrl/beneficiary";
static final ACTIVITY_DETAILS = "$baseUrl/account/activity";
static final BENEFICIARY_ACCOUNTS = "$baseUrl/beneficiary";
static final LOAN_ACCOUNT_TRANSACTIONS = "$baseUrl/account/loan/history";
static final ACCOUNT_TRANSACTIONS = "$baseUrl/uco/accountStatement";
static final LOAN_ACCOUNT_DETAILS = "$baseUrl/account/indvdetails";
static final FETCH_PAYMENT_PURPOSE = "$baseUrl/getPurposes";
static final SET_PASSWORD = "$baseUrl/customer/set-password";
}

@ -297,12 +297,12 @@ class AccountStatementController extends GetxController {
var lastDate = DateTime(range[1]!.year, range[1]!.month, range[1]!.day, 23, 59, 59, 999);
// var currentDate = DateTime.now();
// if (lastDate.isAfter(currentDate) || !lastDate.isAtSameMomentAs(currentDate)) {
// // Show error message if the to date is after the current date (excluding current date)
// Toasty.error("Please select a date range up to the current date.");
// return;
// }
var currentDate = DateTime.now();
if (lastDate.isAfter(currentDate) || !lastDate.isAtSameMomentAs(currentDate)) {
// Show error message if the to date is after the current date (excluding current date)
Toasty.error("Please select a date range up to the current date.");
return;
}
dp("First date", firstDate);

@ -3,13 +3,17 @@ import 'package:get/get.dart';
import 'package:uco_mobile_poc/app/modules/add_money/controllers/payment_method_controller.dart';
import '../../../core/constants/app_contants.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../core/enums/request_constants.dart';
import '../../../core/utils/SessionCache.dart';
import '../../../custom_widgets/Fields/field_validations.dart';
import '../../../custom_widgets/Fields/input_field.dart';
import '../../../custom_widgets/custom_dialog.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/DepositAccountResponse.dart';
import '../../../models/GLACCAddMoneyRequestModel.dart';
import '../../../models/TransactionPinRequestModel.dart';
import '../../../models/evaluated_cuency_model.dart';
import '../../../models/product_model.dart';
import '../../../routes/app_pages.dart';
@ -31,12 +35,14 @@ class AddMoneyController extends GetxController {
late InputField amountFeild;
// late InputField convertedFeild;
late InputField convertedFeild;
late InputField searchCurrency;
late InputField searchAccount;
late InputField userTransactionPinField;
List<DepositAccount> accountList = List.from(SessionCache.instance.depositAccountList);
List<DepositAccount> allAccountList = List.from(SessionCache.instance.depositAccountList);
@ -129,7 +135,7 @@ class AddMoneyController extends GetxController {
}
if (selectRecepientAccount.value.pcrCurrcode.isEmpty) {
// Toasty.error("Please select recipient currency");
Toasty.error("Please select recipient currency");
return;
}
@ -148,7 +154,6 @@ class AddMoneyController extends GetxController {
}
getCurrencyList() async {
//
var responce = await repository.getCurrencyList();
if (responce.isError) {
Toasty.error(responce.errorMsg);
@ -171,63 +176,63 @@ class AddMoneyController extends GetxController {
bool checkForNull() {
if (evaluatedCurrencyModel.value.pcrCurrcode == null || evaluatedCurrencyModel.value.serviceCharges == null || evaluatedCurrencyModel.value.sgtGntramtfc == null || evaluatedCurrencyModel.value.targetPerEratrateact == null) {
return true;
return true;
}
return false;
}
Future<void> navigateToNextScreen() async {
// if (!validate()) {
// if (amountFeild.getCustomText().trim().isEmpty) {
// Toasty.error("Please Input amount and then proceed");
// return;
// }
// if (paymnetController.paymentMethod.value.title.isEmpty) {
// Toasty.error("Please select payment method and then proceed");
// return;
// }
// }
if (!validate()) {
if (amountFeild.getCustomText().trim().isEmpty) {
Toasty.error("Please Input amount and then proceed");
return;
}
if (paymnetController.paymentMethod.value.title.isEmpty) {
Toasty.error("Please select payment method and then proceed");
return;
}
}
await getConversionAmount();
// GLACCAddMoneyRequestModel requestModel = GLACCAddMoneyRequestModel(
// porOrgacode: RequestConstants.porOrgacode,
// pctCstycode: RequestConstants.pctCstycode,
// channelCode: RequestConstants.channelCode,
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
// drPcaGlaccode: "",
// drPcaGlacdesc: "",
// crMbmBkmsnumber: selectRecepientAccount.value.mbmBkmsnumber,
// crMbmBkmstitle: selectRecepientAccount.value.mbmBkmstitle,
// crPcrCurrcode: selectRecepientAccount.value.pcrCurrcode,
// crPcrCurrdesc: selectRecepientAccount.value.pcrCurrdesc,
// crPcrCurrshort: selectRecepientAccount.value.pcrCurrshort,
// sgtGntrnarration: "",
// dmpProdCode: selectRecepientAccount.value.dmpProdcode,
// notificationId: "",
// transMode: "Online",
// sgtGntramtfc: double.parse(recipientController.text.isEmpty ? "0.0" : recipientController.text),
// otdTrancomment: "",
// obpPincode: "",
// transType: "",
// pinType: "",
// );
// TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
// porOrgacode: RequestConstants.porOrgacode,
// pctCstycode: RequestConstants.pctCstycode,
// channelCode: RequestConstants.channelCode,
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
// email: SessionCache.instance.userInfo.cmpUserId,
// pinType: "TRAN",
// transPincode: userTransactionPinField.getCustomText(),
// isOtpRequired: false,
// );
GLACCAddMoneyRequestModel requestModel = GLACCAddMoneyRequestModel(
porOrgacode: RequestConstants.porOrgacode,
pctCstycode: RequestConstants.pctCstycode,
channelCode: RequestConstants.channelCode,
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
drPcaGlaccode: "",
drPcaGlacdesc: "",
crMbmBkmsnumber: selectRecepientAccount.value.mbmBkmsnumber,
crMbmBkmstitle: selectRecepientAccount.value.mbmBkmstitle,
crPcrCurrcode: selectRecepientAccount.value.pcrCurrcode,
crPcrCurrdesc: selectRecepientAccount.value.pcrCurrdesc,
crPcrCurrshort: selectRecepientAccount.value.pcrCurrshort,
sgtGntrnarration: "",
dmpProdCode: selectRecepientAccount.value.dmpProdcode,
notificationId: "",
transMode: "Online",
sgtGntramtfc: double.parse(recipientController.text.isEmpty ? "0.0" : recipientController.text),
otdTrancomment: "",
obpPincode: "",
transType: "",
pinType: "",
);
TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
porOrgacode: RequestConstants.porOrgacode,
pctCstycode: RequestConstants.pctCstycode,
channelCode: RequestConstants.channelCode,
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
email: SessionCache.instance.userInfo.cmpUserId,
pinType: "TRAN",
transPincode: userTransactionPinField.getCustomText(),
isOtpRequired: false,
);
Get.toNamed(
Routes.GENERAL_LEDGER,
// arguments: {
// AppConstants.SEND_TRANS_STEP1_DATA: requestModel,
// AppConstants.EXCHANGE_RATE: evaluatedCurrencyModel.value,
// },
arguments: {
AppConstants.SEND_TRANS_STEP1_DATA: requestModel,
AppConstants.EXCHANGE_RATE: evaluatedCurrencyModel.value,
},
);
}
@ -243,7 +248,7 @@ class AddMoneyController extends GetxController {
var search = searchCurrency.getCustomText().toLowerCase();
currencyList.clear();
update();
// await Future.delayed(Duration(milliseconds: 100));
await Future.delayed(Duration(milliseconds: 100));
if (search.isNotEmpty) {
currencyList = allCurrencyList
.where(
@ -258,8 +263,6 @@ class AddMoneyController extends GetxController {
}
void searchAccountMethod() async {
//
var accountText = searchAccount.getCustomText().toLowerCase();
accountList.clear();
@ -267,8 +270,6 @@ class AddMoneyController extends GetxController {
update();
if (accountText.isNotEmpty) {
//
accountList = allAccountList
.where(
(element) => element.mbmBkmsnumber.toLowerCase().contains(accountText) || element.dmpProddesc.toLowerCase().contains(accountText) || element.pcrCurrcode.toLowerCase().contains(accountText) || element.mbmBkmstitle.toLowerCase().contains(accountText),

@ -3,9 +3,13 @@ import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart';
import 'package:timer_count_down/timer_controller.dart';
import '../../../core/config/server_response.dart';
import '../../../core/constants/app_contants.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../custom_widgets/custom_dialog.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/GLACCAddMoneyRequestModel.dart';
import '../../../models/evaluated_cuency_model.dart';
import '../../../routes/app_pages.dart';
import '../../general_ledger/controllers/general_ledger_controller.dart';
@ -20,24 +24,24 @@ class AddMoneyOTPController extends GetxController {
CountdownController countdownController =
CountdownController(autoStart: true);
// GLACCAddMoneyRequestModel transactionSubmitRequestModel =
// GLACCAddMoneyRequestModel.empty();
// Rx<EvaluatedCurrencyModel> evaluatedCurrencyModel =
// EvaluatedCurrencyModel.empty().obs;
// @override
// void onInit() {
// super.onInit();
// var arguments = Get.arguments;
// transactionSubmitRequestModel = (arguments != null
// ? arguments[AppConstants.SEND_TRANS_STEP1_DATA] ??
// GLACCAddMoneyRequestModel.empty()
// : GLACCAddMoneyRequestModel.empty());
// evaluatedCurrencyModel.value = (arguments != null
// ? arguments[AppConstants.EXCHANGE_RATE] ??
// EvaluatedCurrencyModel.empty()
// : EvaluatedCurrencyModel.empty());
// }
GLACCAddMoneyRequestModel transactionSubmitRequestModel =
GLACCAddMoneyRequestModel.empty();
Rx<EvaluatedCurrencyModel> evaluatedCurrencyModel =
EvaluatedCurrencyModel.empty().obs;
@override
void onInit() {
super.onInit();
var arguments = Get.arguments;
transactionSubmitRequestModel = (arguments != null
? arguments[AppConstants.SEND_TRANS_STEP1_DATA] ??
GLACCAddMoneyRequestModel.empty()
: GLACCAddMoneyRequestModel.empty());
evaluatedCurrencyModel.value = (arguments != null
? arguments[AppConstants.EXCHANGE_RATE] ??
EvaluatedCurrencyModel.empty()
: EvaluatedCurrencyModel.empty());
}
Future<void> validatePinAndNavigate() async {
if (pinPutController.text.isEmpty) {
@ -48,19 +52,19 @@ class AddMoneyOTPController extends GetxController {
Toasty.error("Please enter a valid OTP");
return;
}
// transactionSubmitRequestModel
// transactionSubmitRequestModel.pinType = "TRAN";
// transactionSubmitRequestModel.obpPincode = pinPutController.text;
transactionSubmitRequestModel;
transactionSubmitRequestModel.pinType = "TRAN";
transactionSubmitRequestModel.obpPincode = pinPutController.text;
sendTransaction();
}
Future<void> sendTransaction() async {
// ServerResponse response =
// await repository.sendAddMoneyTransaction(transactionSubmitRequestModel);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
ServerResponse response =
await repository.sendAddMoneyTransaction(transactionSubmitRequestModel);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
Get.find<GeneralLedgerController>().clearAll();

@ -81,12 +81,12 @@ class AddMoneyView extends GetView<AddMoneyController> {
height: 60,
child: Row(
children: [
// Image.asset(controller.getFlagWithCurrencyCode(controller.selectedFromAccountCurrency.value.pcrCurrcode), width: 22),
// const SizedBox(width: 6),
// Text(
// controller.selectedFromAccountCurrency.value.dmpProdshort,
// style: context.textTheme.bodyMedium!.copyWith(fontSize: 16, color: AppColors.colorPrimary, fontWeight: FontWeight.w600),
// ),
Image.asset(controller.getFlagWithCurrencyCode(controller.selectedFromAccountCurrency.value.pcrCurrcode), width: 22),
const SizedBox(width: 6),
Text(
controller.selectedFromAccountCurrency.value.dmpProdshort,
style: context.textTheme.bodyMedium!.copyWith(fontSize: 16, color: AppColors.colorPrimary, fontWeight: FontWeight.w600),
),
const SizedBox(width: 105),
Image.asset(AppAssets.drop_down_ic, width: 10, height: 10),
const SizedBox(width: 6),

@ -21,7 +21,7 @@ class AddMoneyOTPView extends GetView<AddMoneyOTPController> {
Widget build(BuildContext context) {
return Scaffold(
appBar: DashBoardAppBar(
//title: TranslationKeys.makeTranslation(TranslationKeys.textUReceived),
title: TranslationKeys.makeTranslation(TranslationKeys.textUReceived),
onBackButtonPressed: () {
Get.back();
},

@ -16,7 +16,7 @@ class PaymentMethodView extends GetView<PaymentMethodController> {
Widget build(BuildContext context) {
return Scaffold(
appBar: DashBoardAppBar(
//title: TranslationKeys.makeTranslation(TranslationKeys.transUtilityBillCategory),
title: TranslationKeys.makeTranslation(TranslationKeys.transUtilityBillCategory),
onBackButtonPressed: () {
Navigator.of(context).pop();
},

@ -1,13 +1,17 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../core/config/server_response.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../core/utils/SessionCache.dart';
import '../../../core/utils/fields_utils.dart';
import '../../../core/utils/logs_utils.dart';
import '../../../custom_widgets/Fields/field_validations.dart';
import '../../../custom_widgets/Fields/input_field.dart';
import '../../../custom_widgets/custom_dialog.dart';
import '../../../custom_widgets/custom_dropdown.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/AddNewAccountRequestModel.dart';
import '../../../models/product_model.dart';
import '../../../routes/app_pages.dart';
import '../../dashboard/controllers/dashboard_screen_controller.dart';
@ -35,32 +39,32 @@ class AddNewAccountController extends GetxController {
@override
void onInit() {
super.onInit();
// getCurrencyList();
getCurrencyList();
}
/// Validate Function of contorller
// bool validate() {
// bool isValid = FieldValidation.validateAll([nameAddressField, currencyCodesField]);
// return isValid;
// }
bool validate() {
bool isValid = FieldValidation.validateAll([nameAddressField, currencyCodesField]);
return isValid;
}
/// Get Currency List Function
getCurrencyList() async {
try {
var productResponse = await repository.getCurrencyList();
//
// if (productResponse.isError) {
// Toasty.error(productResponse.errorMsg);
// return;
// }
//
// currencyList = ProductDepositModel.productListFromJson(productResponse.response);
//
// currencyListDropDown = currencyList.map((e) => DropDown(e.dmpProdcode, e.dmpProddesc, e)).toList();
//
// dropDownValue = currencyListDropDown.first;
//
// dp("DmpProductCode", currencyListDropDown);
if (productResponse.isError) {
Toasty.error(productResponse.errorMsg);
return;
}
currencyList = ProductDepositModel.productListFromJson(productResponse.response);
currencyListDropDown = currencyList.map((e) => DropDown(e.dmpProdcode, e.dmpProddesc, e)).toList();
dropDownValue = currencyListDropDown.first;
dp("DmpProductCode", currencyListDropDown);
update();
} catch (e, s) {
@ -71,29 +75,26 @@ class AddNewAccountController extends GetxController {
/// New Create Account Request Function
void validateAndSendRequest() async {
//
hideKeyBoard();
if (!validate()) {
Toasty.error("Please input and then proceed");
return;
}
// if (!validate()) {
// Toasty.error("Please input and then proceed");
// return;
// }
// AddNewAccountRequestModel request = AddNewAccountRequestModel(
// title: nameAddressField.getCustomText(),
// porOrgacode: SessionCache.instance.userInfo.porOrgacode,
// channelCode: SessionCache.instance.userInfo.channelCode,
// dmpProdcode: dropDownValue.id,
// email: SessionCache.instance.userInfo.cmpUserId,
// );
//
// ServerResponse response = await repository.addNewAccount(request);
//
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
AddNewAccountRequestModel request = AddNewAccountRequestModel(
title: nameAddressField.getCustomText(),
porOrgacode: SessionCache.instance.userInfo.porOrgacode,
channelCode: SessionCache.instance.userInfo.channelCode,
dmpProdcode: dropDownValue.id,
email: SessionCache.instance.userInfo.cmpUserId,
);
ServerResponse response = await repository.addNewAccount(request);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
CustomDialog.showSuccessDialog(
description: "Thank you so much, Your new account has been created successfully",

@ -71,18 +71,18 @@ class AddNewAccountView extends GetView<AddNewAccountController> {
controller.validateAndSendRequest();
},
),
// const SizedBox(height: 30),
// Padding(
// padding: const EdgeInsets.only(left: 20, right: 30, bottom: 10),
// child: CustomButton(
// onPressed: () {
// controller.validateAndSendRequest();
// },
// buttonText: TranslationKeys.makeTranslation(TranslationKeys.textCreateAccount),
// buttonColor: AppColors.colorButton,
// buttonPadding: const EdgeInsets.only(top: 12, bottom: 12),
// ),
// )
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.only(left: 20, right: 30, bottom: 10),
child: CustomButton(
onPressed: () {
controller.validateAndSendRequest();
},
buttonText: TranslationKeys.makeTranslation(TranslationKeys.textCreateAccount),
buttonColor: AppColors.colorButton,
buttonPadding: const EdgeInsets.only(top: 12, bottom: 12),
),
)
],
),
),

@ -24,7 +24,6 @@ class BeneficiaryManagementController extends GetxController {
Toasty.error(response.errorMsg);
return;
}
// Assuming the response contains a list of beneficiary account data
List<dynamic> data = response.response;
if (data != null) {
@ -72,5 +71,4 @@ class BeneficiaryManagementController extends GetxController {
}).toList());
}
}
}

@ -1,8 +1,13 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../core/config/server_response.dart';
import '../../../core/constants/app_contants.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../core/enums/request_constants.dart';
import '../../../core/utils/SessionCache.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/ChangeTransactionPinRequest.dart';
import '../../../routes/app_pages.dart';
@ -29,10 +34,10 @@ class ChangeTransactionPinController extends GetxController {
return;
}
// if (oldTransactionPinController.text != newTransactionPinController.text) {
// Toasty.error("Old and New Transaction Pin not match!");
// return;
// }
if (oldTransactionPinController.text != newTransactionPinController.text) {
Toasty.error("Old and New Transaction Pin not match!");
return;
}
if (newTransactionPinController.text != confirmTransactionPinController.text) {
Toasty.error("New and Confirm Transaction Pin not match!");
@ -40,31 +45,31 @@ class ChangeTransactionPinController extends GetxController {
}
// ChangeTransactionPinRequest request = ChangeTransactionPinRequest(
// oldTransPincode: oldTransactionPinController.text,
// newTransPincode: newTransactionPinController.text,
// channelCode: RequestConstants.channelCode,
// porOrgacode: RequestConstants.porOrgacode,
// pctCstycode: RequestConstants.pctCstycode,
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
// isOtpRequired: false,
// pinType: AppConstants.PIN_TYPE_Transaction,
//
// );
//
// ServerResponse response = await repository.changeTransactionPin(request);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
ChangeTransactionPinRequest request = ChangeTransactionPinRequest(
oldTransPincode: oldTransactionPinController.text,
newTransPincode: newTransactionPinController.text,
channelCode: RequestConstants.channelCode,
porOrgacode: RequestConstants.porOrgacode,
pctCstycode: RequestConstants.pctCstycode,
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
isOtpRequired: false,
pinType: AppConstants.PIN_TYPE_Transaction,
);
ServerResponse response = await repository.changeTransactionPin(request);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
Get.toNamed(Routes.CHANGE_TRANSACTION_PIN_OTP,
// arguments: {
// 'oldTransactionPin': oldTransactionPinController.text,
// 'newTransactionPin': newTransactionPinController.text,
// 'confirmTransactionPin': confirmTransactionPinController.text,
// AppConstants.CHANGE_TRANSACTION_PIN_OTP: request,
// },
arguments: {
'oldTransactionPin': oldTransactionPinController.text,
'newTransactionPin': newTransactionPinController.text,
'confirmTransactionPin': confirmTransactionPinController.text,
AppConstants.CHANGE_TRANSACTION_PIN_OTP: request,
},
);
clearController();

@ -1,105 +1,106 @@
// import 'package:flutter/cupertino.dart';
// import 'package:flutter_contacts/flutter_contacts.dart';
// import 'package:get/get.dart';
// import 'package:permission_handler/permission_handler.dart';
// import 'package:uco_mobile_poc_project/app/core/constants/app_contants.dart';
// import 'package:uco_mobile_poc_project/app/core/constants/translation_keys.dart';
// import 'package:uco_mobile_poc_project/app/core/dialogs/custom_loading.dart';
// import 'package:uco_mobile_poc_project/app/custom_widgets/Fields/input_field.dart';
// import 'package:uco_mobile_poc_project/app/custom_widgets/custom_toasty.dart';
//
// class ContactsScreenController extends GetxController {
// static TextEditingController phoneController = TextEditingController();
// Contact? selectedContact;
//
// List<Contact> contactsList = [];
// RxList<Contact> filteredContacts = <Contact>[].obs;
//
// late InputField searchContacts;
//
// @override
// void onInit() {
// super.onInit();
// _loadContacts();
// }
//
// @override
// onReady() {
// super.onReady();
// // searchContacts.controller?.addListener(() {
// // if (searchContacts.getCustomText().isEmpty) {
// // filteredContacts.assignAll(contactsList);
// // } else {
// // filteredContacts.value = contactsList.where((element) => element.name.first == searchContacts.getCustomText() || element.name.last == searchContacts.getCustomText()).toList();
// // }
// // });
// }
//
// Future<void> _loadContacts() async {
// /// Check if the app has permission to access contacts
// var status = await Permission.contacts.status;
// // showLoader();
// if (status.isGranted) {
// /// Permission is granted, load contacts
// try {
// contactsList = await FlutterContacts.getContacts(withProperties: true, withAccounts: true, withPhoto: true, sorted: true, withThumbnail: true);
// filteredContacts.assignAll(contactsList);
// hideLoader();
// } catch (e) {
// print('Error loading contacts: $e');
// hideLoader();
// }
// } else {
// /// Permission is not granted, request permission
// await _requestPermissions();
// hideLoader();
// }
// hideLoader();
// }
//
// Future<void> _requestPermissions() async {
// /// Request contacts permission
// var status = await Permission.contacts.request();
// if (!status.isGranted) {
// Toasty.error(TranslationKeys.makeTranslation(TranslationKeys.textPermissionDenied));
// } else {
// /// Permission granted, load contacts
// await _loadContacts();
// }
// }
//
// /// Function to filter contacts based on search query
// void filterContacts(String searchText) {
// if (searchText.isEmpty) {
// filteredContacts.assignAll(contactsList);
// } else {
// searchText = searchText.toLowerCase();
// filteredContacts.assignAll(contactsList.where((contact) {
// // Check if either name or phone number matches the search text
// bool matchesName = contact.name.first.toLowerCase().contains(searchText) ||
// (contact.name.last != null && contact.name.last!.toLowerCase().contains(searchText));
//
// bool matchesPhoneNumber = false;
// for (var number in contact.phones) {
// if (number.number.toLowerCase().contains(searchText)) {
// matchesPhoneNumber = true;
// break;
// }
// }
//
// return matchesName || matchesPhoneNumber;
// }).toList());
// }
// }
// /// Phone number pattern
// String flattenPhoneNumber(String phoneStr) {
// return phoneStr.replaceAllMapped(RegExp(r'^(\+)|\D'), (Match m) {
// return m[0] == "+" ? "+" : "";
// });
// }
//
// void handleContactSelection(Contact selectedContact) {
// Get.back(result: {AppConstants.SELECTED_CONTACT: selectedContact});
// }
//
// }
import 'package:flutter/cupertino.dart';
import 'package:flutter_contacts/flutter_contacts.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../../core/constants/app_contants.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../core/dialogs/custom_loading.dart';
import '../../../custom_widgets/Fields/input_field.dart';
import '../../../custom_widgets/custom_toasty.dart';
class ContactsScreenController extends GetxController {
static TextEditingController phoneController = TextEditingController();
Contact? selectedContact;
List<Contact> contactsList = [];
RxList<Contact> filteredContacts = <Contact>[].obs;
late InputField searchContacts;
@override
void onInit() {
super.onInit();
_loadContacts();
}
@override
onReady() {
super.onReady();
searchContacts.controller?.addListener(() {
if (searchContacts.getCustomText().isEmpty) {
filteredContacts.assignAll(contactsList);
} else {
filteredContacts.value = contactsList.where((element) => element.name.first == searchContacts.getCustomText() || element.name.last == searchContacts.getCustomText()).toList();
}
});
}
Future<void> _loadContacts() async {
/// Check if the app has permission to access contacts
var status = await Permission.contacts.status;
showLoader();
if (status.isGranted) {
/// Permission is granted, load contacts
try {
contactsList = await FlutterContacts.getContacts(withProperties: true, withAccounts: true, withPhoto: true, sorted: true, withThumbnail: true);
filteredContacts.assignAll(contactsList);
hideLoader();
} catch (e) {
print('Error loading contacts: $e');
hideLoader();
}
} else {
/// Permission is not granted, request permission
await _requestPermissions();
hideLoader();
}
hideLoader();
}
Future<void> _requestPermissions() async {
/// Request contacts permission
var status = await Permission.contacts.request();
if (!status.isGranted) {
Toasty.error(TranslationKeys.makeTranslation(TranslationKeys.textPermissionDenied));
} else {
/// Permission granted, load contacts
await _loadContacts();
}
}
/// Function to filter contacts based on search query
void filterContacts(String searchText) {
if (searchText.isEmpty) {
filteredContacts.assignAll(contactsList);
} else {
searchText = searchText.toLowerCase();
filteredContacts.assignAll(contactsList.where((contact) {
// Check if either name or phone number matches the search text
bool matchesName = contact.name.first.toLowerCase().contains(searchText) ||
(contact.name.last != null && contact.name.last!.toLowerCase().contains(searchText));
bool matchesPhoneNumber = false;
for (var number in contact.phones) {
if (number.number.toLowerCase().contains(searchText)) {
matchesPhoneNumber = true;
break;
}
}
return matchesName || matchesPhoneNumber;
}).toList());
}
}
/// Phone number pattern
String flattenPhoneNumber(String phoneStr) {
return phoneStr.replaceAllMapped(RegExp(r'^(\+)|\D'), (Match m) {
return m[0] == "+" ? "+" : "";
});
}
void handleContactSelection(Contact selectedContact) {
Get.back(result: {AppConstants.SELECTED_CONTACT: selectedContact});
}
}

@ -1,107 +1,106 @@
// import 'package:flutter/material.dart';
// import 'package:get/get.dart';
// import 'package:uco_mobile_poc_project/app/core/constants/translation_keys.dart';
// import 'package:uco_mobile_poc_project/app/custom_widgets/custom_no_record.dart';
// import 'package:uco_mobile_poc_project/app/res/app_colors.dart';
// import 'package:uco_mobile_poc_project/app/res/app_dimensions.dart';
//
// import '../../../custom_widgets/custom_app_bar.dart';
// import '../controllers/contacts_screen_controller.dart';
//
// class ContactsScreenView extends GetView<ContactsScreenController> {
// const ContactsScreenView({Key? key}) : super(key: key);
//
// @override
// Widget build(BuildContext context) {
// String className = runtimeType.toString().split('.').last;
// return Scaffold(
// appBar: DashBoardAppBar(
// title: TranslationKeys.makeTranslation("Contacts"),
// onBackButtonPressed: () {
// Get.back();
// },
// ),
// body: Padding(
// padding: EdgeInsets.symmetric(vertical: AppDimensions.screenVerticalPadding, horizontal: AppDimensions.screenHorizontalPadding),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// TextField(
// style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w400, fontSize: 12),
// decoration: const InputDecoration(
// suffixIconColor: AppColors.colorPrimary,
// filled: true,
// fillColor: AppColors.colorGrey200,
// enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, color: Colors.transparent)),
// border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, color: AppColors.colorGrey500)),
// focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, style: BorderStyle.solid, color: Colors.transparent)),
// hintText: 'Search contact number',
// hintStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: AppColors.colorGrey500),
// suffixIcon: Icon(Icons.search_rounded, size: 22),
// ),
// onChanged: (value) {
// controller.filterContacts(value);
// }),
// const SizedBox(height: 20),
// Text(TranslationKeys.makeTranslation("Contacts"), style: Theme.of(context).textTheme.bodyMedium),
// const SizedBox(height: 10),
// Obx(() {
// return controller.filteredContacts.isEmpty
// ? const Center(
// child: CustomNoRecord(title: "No Record Found", description: "We couldn't find any activity at this moment"),
// )
// : Expanded(
// flex: 2,
// child: ListView.builder(
// itemCount: controller.filteredContacts.length,
// itemBuilder: (context, index) {
// final contact = controller.filteredContacts[index];
// final phoneNumber = contact.phones.isNotEmpty ? contact.phones[0].number : 'No phone number';
// return ListTile(
// onTap: () {
// controller.handleContactSelection(contact);
// },
// title: Text(contact.displayName),
// subtitle: Text(
// phoneNumber,
// style: Theme.of(context).textTheme.bodySmall,
// ),
// leading: CircleAvatar(
// backgroundColor: AppColors.colorPrimary,
// backgroundImage: contact.photo != null ? MemoryImage(contact.photo!) : null,
// child: Text(
// getInitials(contact.displayName),
// style: Theme.of(context).textTheme.titleSmall?.copyWith(color: Colors.white),
// ),
// ),
// );
// },
// ),
// );
// }),
// ],
// ),
// ),
// );
// }
//
// String getInitials(String fullName) {
// if (fullName.isEmpty) {
// return "";
// }
//
// // Split the full name into words
// List<String> nameParts = fullName.trim().split(' ');
//
// // Check if there's at least a first and last name
// if (nameParts.length < 2) {
// return fullName.substring(0, 1).toUpperCase(); // Get first character
// }
//
// // Get first characters of first and last name
// String firstInitial = nameParts[0].substring(0, 1).toUpperCase();
// String lastInitial = nameParts[nameParts.length - 1].substring(0, 1).toUpperCase();
//
// return firstInitial + lastInitial;
// }
// }
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../custom_widgets/custom_app_bar.dart';
import '../../../custom_widgets/custom_no_record.dart';
import '../../../res/app_colors.dart';
import '../../../res/app_dimensions.dart';
import '../controllers/contacts_screen_controller.dart';
class ContactsScreenView extends GetView<ContactsScreenController> {
const ContactsScreenView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
String className = runtimeType.toString().split('.').last;
return Scaffold(
appBar: DashBoardAppBar(
title: TranslationKeys.makeTranslation("Contacts"),
onBackButtonPressed: () {
Get.back();
},
),
body: Padding(
padding: EdgeInsets.symmetric(vertical: AppDimensions.screenVerticalPadding, horizontal: AppDimensions.screenHorizontalPadding),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w400, fontSize: 12),
decoration: const InputDecoration(
suffixIconColor: AppColors.colorPrimary,
filled: true,
fillColor: AppColors.colorGrey200,
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, color: Colors.transparent)),
border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, color: AppColors.colorGrey500)),
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(width: 1, style: BorderStyle.solid, color: Colors.transparent)),
hintText: 'Search contact number',
hintStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: AppColors.colorGrey500),
suffixIcon: Icon(Icons.search_rounded, size: 22),
),
onChanged: (value) {
controller.filterContacts(value);
}),
const SizedBox(height: 20),
Text(TranslationKeys.makeTranslation("Contacts"), style: Theme.of(context).textTheme.bodyMedium),
const SizedBox(height: 10),
Obx(() {
return controller.filteredContacts.isEmpty
? const Center(
child: CustomNoRecord(title: "No Record Found", description: "We couldn't find any activity at this moment"),
)
: Expanded(
flex: 2,
child: ListView.builder(
itemCount: controller.filteredContacts.length,
itemBuilder: (context, index) {
final contact = controller.filteredContacts[index];
final phoneNumber = contact.phones.isNotEmpty ? contact.phones[0].number : 'No phone number';
return ListTile(
onTap: () {
controller.handleContactSelection(contact);
},
title: Text(contact.displayName),
subtitle: Text(
phoneNumber,
style: Theme.of(context).textTheme.bodySmall,
),
leading: CircleAvatar(
backgroundColor: AppColors.colorPrimary,
backgroundImage: contact.photo != null ? MemoryImage(contact.photo!) : null,
child: Text(
getInitials(contact.displayName),
style: Theme.of(context).textTheme.titleSmall?.copyWith(color: Colors.white),
),
),
);
},
),
);
}),
],
),
),
);
}
String getInitials(String fullName) {
if (fullName.isEmpty) {
return "";
}
// Split the full name into words
List<String> nameParts = fullName.trim().split(' ');
// Check if there's at least a first and last name
if (nameParts.length < 2) {
return fullName.substring(0, 1).toUpperCase(); // Get first character
}
// Get first characters of first and last name
String firstInitial = nameParts[0].substring(0, 1).toUpperCase();
String lastInitial = nameParts[nameParts.length - 1].substring(0, 1).toUpperCase();
return firstInitial + lastInitial;
}
}

@ -64,7 +64,7 @@ class CreateTransactionPinOtpController extends GetxController {
clearController();
CustomDialog.showSuccessDialog(
// title: "Congratulations!",
title: "Congratulations!",
description: "Your Transaction pin successfully ! An send email and message have been sent to you.",
onTapPositive: () {
Get.offAllNamed(Routes.DASHBOARD_SCREEN);

@ -7,13 +7,17 @@ import '../../../core/config/server_response.dart';
import '../../../core/constants/app_contants.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../core/enums/request_constants.dart';
import '../../../core/utils/SessionCache.dart';
import '../../../custom_widgets/Fields/field_validations.dart';
import '../../../custom_widgets/Fields/input_field.dart';
import '../../../custom_widgets/custom_button.dart';
import '../../../custom_widgets/custom_dropdown.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/GLACCAddMoneyRequestModel.dart';
import '../../../models/GlsResponseModel.dart';
import '../../../models/SendTransactionStep1ResponseModel.dart';
import '../../../models/TransactionPinRequestModel.dart';
import '../../../models/evaluated_cuency_model.dart';
import '../../../res/app_colors.dart';
import '../../../routes/app_pages.dart';
@ -34,13 +38,13 @@ class GeneralLedgerController extends GetxController {
void onInit() {
super.onInit();
// var arguments = Get.arguments;
//
// transactionSubmitRequestModel = (arguments != null ? arguments[AppConstants.SEND_TRANS_STEP1_DATA] ?? GLACCAddMoneyRequestModel.empty() : GLACCAddMoneyRequestModel.empty());
//
// evaluatedCurrencyModel.value = (arguments != null ? arguments[AppConstants.EXCHANGE_RATE] ?? EvaluatedCurrencyModel.empty() : EvaluatedCurrencyModel.empty());
//
// fetchAllGlsAccounts();
var arguments = Get.arguments;
transactionSubmitRequestModel = (arguments != null ? arguments[AppConstants.SEND_TRANS_STEP1_DATA] ?? GLACCAddMoneyRequestModel.empty() : GLACCAddMoneyRequestModel.empty());
evaluatedCurrencyModel.value = (arguments != null ? arguments[AppConstants.EXCHANGE_RATE] ?? EvaluatedCurrencyModel.empty() : EvaluatedCurrencyModel.empty());
fetchAllGlsAccounts();
}
@override
@ -50,7 +54,7 @@ class GeneralLedgerController extends GetxController {
}
void updateSelectedDeposit(DropDown item) {
// selectedGlAccount.value = item;
selectedGlAccount.value = item;
}
clearAll() {
@ -178,45 +182,45 @@ class GeneralLedgerController extends GetxController {
);
}
// bool validate() {
// bool isValid = FieldValidation.validateAll([glsAccounts, userTransactionPinField]);
// return isValid;
// }
bool validate() {
bool isValid = FieldValidation.validateAll([glsAccounts, userTransactionPinField]);
return isValid;
}
Future<void> handleNextClick() async {
// if (!validate()) {
// Toasty.error("Please input and then proceed");
// return;
// }
// TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
// porOrgacode: RequestConstants.porOrgacode,
// pctCstycode: RequestConstants.pctCstycode,
// channelCode: RequestConstants.channelCode,
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
// email: SessionCache.instance.userInfo.cmpUserId,
// pinType: "TRAN",
// transPincode: userTransactionPinField.getCustomText(),
// isOtpRequired: false,
// );
//
// ServerResponse response = await repository.sendAddMoneyOtp(transactionPinRequestModel);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
// SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
// transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
//
// GlsResponseModel responseModel = selectedGlAccount.value!.data as GlsResponseModel;
// transactionSubmitRequestModel.drPcaGlaccode = responseModel.pcaGlaccode;
// transactionSubmitRequestModel.drPcaGlacdesc = responseModel.pcaGlacdesc;
if (!validate()) {
Toasty.error("Please input and then proceed");
return;
}
TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
porOrgacode: RequestConstants.porOrgacode,
pctCstycode: RequestConstants.pctCstycode,
channelCode: RequestConstants.channelCode,
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
email: SessionCache.instance.userInfo.cmpUserId,
pinType: "TRAN",
transPincode: userTransactionPinField.getCustomText(),
isOtpRequired: false,
);
ServerResponse response = await repository.sendAddMoneyOtp(transactionPinRequestModel);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
GlsResponseModel responseModel = selectedGlAccount.value!.data as GlsResponseModel;
transactionSubmitRequestModel.drPcaGlaccode = responseModel.pcaGlaccode;
transactionSubmitRequestModel.drPcaGlacdesc = responseModel.pcaGlacdesc;
Get.toNamed(Routes.OTP_ADD_MONEY,
// arguments: {
// AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
// AppConstants.EXCHANGE_RATE: evaluatedCurrencyModel.value,
// }
arguments: {
AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
AppConstants.EXCHANGE_RATE: evaluatedCurrencyModel.value,
}
);
}
}

@ -91,24 +91,24 @@ class GeneralLedgerView extends GetView<GeneralLedgerController> {
),
)),
// Expanded(
// flex: 2,
// child: Padding(
// padding: const EdgeInsets.only(left: 12.0, right: 12.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Text("sdd", style: Theme.of(context).textTheme.bodySmall),
// const SizedBox(height: 10),
// Text("sds", style: Theme.of(context).textTheme.bodySmall),
// const SizedBox(height: 10),
// Text("skks", style: Theme.of(context).textTheme.bodySmall),
// const SizedBox(height: 10),
// Text("sk", style: Theme.of(context).textTheme.bodySmall),
// ],
// ),
// )),
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text("sdd", style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 10),
Text("sds", style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 10),
Text("skks", style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 10),
Text("sk", style: Theme.of(context).textTheme.bodySmall),
],
),
)),
],
),
],

@ -138,19 +138,6 @@ class LoginScreenView extends GetView<LoginScreenController> {
controller.validateAndLogin();
},
),
// controller.userNameField = CustomInputFieldCustom(
// refKey: FormFieldConstants.instance().getFormKey("${className}userNameField"),
// controller: FormFieldConstants.instance().getController("${className}userNameField"),
// labelText: "User Name",
// ),
// const SizedBox(height: 20),
// controller.passwordField = CustomInputFieldCustom(
// refKey: FormFieldConstants.instance().getFormKey("${className}passwordField"),
// controller: FormFieldConstants.instance().getController("${className}passwordField"),
// labelText: "Password",
// requiredPasswordIcon: true,
// isPassword: true,
// ),
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 100),

@ -81,7 +81,8 @@ class OTPScreenController extends GetxController {
Get.offAndToNamed(Routes.CREATE_TRANSACTION_PIN);
return;
}
Get.offAndToNamed(Routes.DASHBOARD_SCREEN, /*arguments: {'loginUsingFingerPrint': loginUsingFingerPrint}*/);
Get.offAndToNamed(Routes.DASHBOARD_SCREEN,
arguments: {'loginUsingFingerPrint': loginUsingFingerPrint});
}
///uco/changeTransactionPin
@ -111,9 +112,9 @@ class OTPScreenController extends GetxController {
isResend.value = false;
// countdownController.setOnRestart(
// () {},
// );
countdownController.setOnRestart(
() {},
);
countdownController.restart();

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_timer_countdown/flutter_timer_countdown.dart';
import 'package:get/get.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:timer_count_down/timer_count_down.dart';
@ -7,8 +8,10 @@ import 'package:timer_count_down/timer_count_down.dart';
import '../../../core/constants/app_assets.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../core/utils/logs_utils.dart';
import '../../../custom_widgets/custom_app_bar.dart';
import '../../../custom_widgets/custom_button.dart';
import '../../../custom_widgets/custom_label.dart';
import '../../../res/app_colors.dart';
import '../../../res/app_dimensions.dart';
import '../controllers/o_t_p_screen_controller.dart';
@ -20,7 +23,7 @@ class OTPScreenView extends GetView<OTPScreenController> {
Widget build(BuildContext context) {
return Scaffold(
appBar: DashBoardAppBar(
//title: TranslationKeys.makeTranslation(TranslationKeys.textUReceived),
title: TranslationKeys.makeTranslation(TranslationKeys.textUReceived),
onBackButtonPressed: () {
Get.back();
},
@ -37,42 +40,7 @@ class OTPScreenView extends GetView<OTPScreenController> {
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
// LabelText(TranslationKeys.makeTranslation(TranslationKeys.textOTP)),
// PinCodeTextField(
// autoDisposeControllers: false,
// keyboardType: TextInputType.number,
// controller: controller.pinPutController,
// showCursor: true,
// autoDismissKeyboard: false,
// enablePinAutofill: true,
// length: 6,
// appContext: context,
// mainAxisAlignment: MainAxisAlignment.center,
// cursorColor: Colors.black.withOpacity(0.8),
// obscureText: false,
// animationType: AnimationType.fade,
// pinTheme: PinTheme(
// selectedColor: AppColors.colorGrey350,
// /*Colors.black.withOpacity(0.6),*/
// inactiveColor: AppColors.colorGrey350,
// /*Colors.black.withOpacity(0.6),*/
// activeColor: AppColors.colorGrey350,
// fieldOuterPadding: const EdgeInsets.all(5),
// shape: PinCodeFieldShape.box,
// borderRadius: BorderRadius.circular(5),
// fieldHeight: 40,
// fieldWidth: 43,
// activeFillColor: Colors.white,
// ),
// animationDuration: const Duration(milliseconds: 100),
// backgroundColor: Colors.transparent,
// enableActiveFill: false,
// onCompleted: (v) {},
// onChanged: (value) {},
// beforeTextPaste: (text) {
// return true;
// },
// ),
LabelText(TranslationKeys.makeTranslation(TranslationKeys.textOTP)),
PinCodeTextField(
autoDisposeControllers: false,
keyboardType: TextInputType.number,
@ -125,18 +93,18 @@ class OTPScreenView extends GetView<OTPScreenController> {
const SizedBox(width: 10),
SvgPicture.asset(AppAssets.ic_clock_circle, height: 20, width: 20),
const SizedBox(width: 5),
// TimerCountdown(
// spacerWidth: 5,
// enableDescriptions: false,
// format: CountDownTimerFormat.minutesSeconds,
// endTime: DateTime.now().add(
// const Duration(seconds: 8),
// ),
// onEnd: () {
// dp("Timer finished", "");
// controller.updateResend(true);
// },
// ),
TimerCountdown(
spacerWidth: 5,
enableDescriptions: false,
format: CountDownTimerFormat.minutesSeconds,
endTime: DateTime.now().add(
const Duration(seconds: 8),
),
onEnd: () {
dp("Timer finished", "");
controller.updateResend(true);
},
),
Countdown(
controller: controller.countdownController,
seconds: 60,

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_contacts/contact.dart';
// import 'package:flutter_contacts/flutter_contacts.dart';
import 'package:get/get.dart';
@ -10,15 +11,19 @@ import '../../../core/constants/app_contants.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../core/utils/SessionCache.dart';
import '../../../core/utils/app_utils.dart';
import '../../../custom_widgets/Fields/field_validations.dart';
import '../../../custom_widgets/Fields/input_field.dart';
import '../../../custom_widgets/custom_dialog.dart';
import '../../../custom_widgets/custom_dropdown.dart';
import '../../../custom_widgets/custom_toasty.dart';
import '../../../models/AccountInquiryResponseModel.dart';
import '../../../models/BeneficiaryAccountModel.dart';
import '../../../models/ExchangeRate.dart';
import '../../../res/app_colors.dart';
import '../../../routes/app_pages.dart';
import '../../qr_setting/controllers/qr_setting_controller.dart';
import '../../qr_setting/views/qr_scan_screen.dart';
class NewBeneficiaryController extends GetxController {
String OPTION_PHONE = "01";
@ -36,14 +41,15 @@ class NewBeneficiaryController extends GetxController {
late InputField recipientCardNameField;
late InputField accountNumberField;
late InputField nickNameField;
late InputField accountTitleField;
// late InputField emailIDField;
// late InputField phoneNumberField;
late InputField emailIDField;
late InputField phoneNumberField;
String receiverAccountNumber = "";
String receiverAccountTitle = "";
RxString currencySymbol = "".obs;
// Contact? selectedContact;
Contact? selectedContact;
ExchangeRate? selectedExchangeRate;
@override
@ -58,14 +64,14 @@ class NewBeneficiaryController extends GetxController {
/// Validate Method
bool validate() {
bool isValid = FieldValidation.validateAll([
// accountTitleField,
// accountNumberField,
accountTitleField,
accountNumberField,
nickNameField,
selectRecipientDetailField
// identityEmailField,
// accountNumberField,
// emailIDField,
// phoneNumberField,
selectRecipientDetailField,
identityEmailField,
accountNumberField,
emailIDField,
phoneNumberField,
]);
if (selectedRecipientDetailOption.value.id == OPTION_PHONE) {
@ -82,23 +88,23 @@ class NewBeneficiaryController extends GetxController {
Toasty.error("Please input and then proceed");
return;
}
// BeneficiaryAccountModel beneficiaryAccountModel = BeneficiaryAccountModel(
// porOrgacode: SessionCache.instance.userInfo.porOrgacode,
// email: SessionCache.instance.userInfo.cmpUserId,
// pcrCurrcode: selectedExchangeRate!.pcrCurrcode,
// pcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
// pcrCurrshort: selectedExchangeRate!.pcrCurrshort,
// mbmBkmstitleRef: receiverAccountTitle,
// mbmBkmsnumberRef: receiverAccountNumber,
// refPhoneNumber: "",
// refEmail: "",
// refNickName: nickNameField.getCustomText(),
// );
// ServerResponse response = await repository.addNewBeneficiary(beneficiaryAccountModel);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
BeneficiaryAccountModel beneficiaryAccountModel = BeneficiaryAccountModel(
porOrgacode: SessionCache.instance.userInfo.porOrgacode,
email: SessionCache.instance.userInfo.cmpUserId,
pcrCurrcode: selectedExchangeRate!.pcrCurrcode,
pcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
pcrCurrshort: selectedExchangeRate!.pcrCurrshort,
mbmBkmstitleRef: receiverAccountTitle,
mbmBkmsnumberRef: receiverAccountNumber,
refPhoneNumber: "",
refEmail: "",
refNickName: nickNameField.getCustomText(),
);
ServerResponse response = await repository.addNewBeneficiary(beneficiaryAccountModel);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
CustomDialog.showSuccessDialog(
description: "You are successfully add new Beneficiary",
onTapPositive: () {
@ -114,20 +120,20 @@ class NewBeneficiaryController extends GetxController {
Future<void> selectContact() async {
dynamic result = await Get.toNamed(Routes.CONTACTS_SCREEN);
// if ((result != null && result[AppConstants.SELECTED_CONTACT] != null)) {
// selectedContact = result[AppConstants.SELECTED_CONTACT];
// identityPhoneNumberField.setText(AppUtils.formatPhoneNumber(selectedContact!.phones.first.number) /*"${selectedContact!.displayName} (${AppUtils.formatPhoneNumber(selectedContact!.phones.first.number + ")")}"*/);
// }
if ((result != null && result[AppConstants.SELECTED_CONTACT] != null)) {
selectedContact = result[AppConstants.SELECTED_CONTACT];
identityPhoneNumberField.setText(AppUtils.formatPhoneNumber(selectedContact!.phones.first.number) /*"${selectedContact!.displayName} (${AppUtils.formatPhoneNumber(selectedContact!.phones.first.number + ")")}"*/);
}
}
// void scanQr() async {
// Get.put(QrSettingController());
// var scanResult = await Get.to(() => const QrScanScreen());
// var resultJson = jsonDecode(scanResult);
// var accNumber = resultJson["phoneNumber"];
// identityPhoneNumberField.setText(accNumber);
// verifyAccountAgainstIt();
// }
void scanQr() async {
Get.put(QrSettingController());
var scanResult = await Get.to(() => const QrScanScreen());
var resultJson = jsonDecode(scanResult);
var accNumber = resultJson["phoneNumber"];
identityPhoneNumberField.setText(accNumber);
verifyAccountAgainstIt();
}
Future<void> verifyAccountAgainstIt() async {
String valua = selectedRecipientDetailOption.value.id == OPTION_PHONE ? identityPhoneNumberField.getCustomText() : (selectedRecipientDetailOption.value.id == OPTION_EMAIL ? identityEmailField.getCustomText() : "");
@ -157,7 +163,7 @@ class NewBeneficiaryController extends GetxController {
accountInquiryList = AccountInquiryResponseModel.fromList(responseData);
accountsDialog(accountInquiryList);
// AccountInquiryResponseModel transactionSubmitRequestModel = AccountInquiryResponseModel.fromMap(((response.response ?? {}) as Map<Object?, Object?>).map((key, value) => MapEntry(key.toString(), value)));
AccountInquiryResponseModel transactionSubmitRequestModel = AccountInquiryResponseModel.fromMap(((response.response ?? {}) as Map<Object?, Object?>).map((key, value) => MapEntry(key.toString(), value)));
}
void updateSelectedCurrency(/*DropDown? item*/ AccountInquiryResponseModel model) {
@ -257,14 +263,14 @@ class NewBeneficiaryController extends GetxController {
/// Clear Controllers Method
void clearNewBeneficiaryControllers() {
// accountTitleField.clear();
accountTitleField.clear();
nickNameField.clear();
selectRecipientDetailField.clear();
identityPhoneNumberField.clear();
recipientCardNameField.clear();
identityEmailField.clear();
// accountNumberField.clear();
// emailIDField.clear();
// phoneNumberField.clear();
accountNumberField.clear();
emailIDField.clear();
phoneNumberField.clear();
}
}

@ -53,18 +53,18 @@ class NewBeneficiaryView extends GetView<NewBeneficiaryController> {
child: Obx(() {
return Column(
children: [
// controller.accountTitleField = InputField(
// refKey: FormFieldConstants.instance().getFormKey("${className}accountTitleField"),
// controller: FormFieldConstants.instance().getController("${className}accountTitleField"),
// labelText: "Account Title",
// hintText: "Enter your account name",
// ),
// controller.accountNumberField = InputField(
// refKey: FormFieldConstants.instance().getFormKey("${className}accountNumberField"),
// controller: FormFieldConstants.instance().getController("${className}accountNumberField"),
// labelText: "Account Number",
// hintText: "Enter your account number",
// ),
controller.accountTitleField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}accountTitleField"),
controller: FormFieldConstants.instance().getController("${className}accountTitleField"),
labelText: "Account Title",
hintText: "Enter your account name",
),
controller.accountNumberField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}accountNumberField"),
controller: FormFieldConstants.instance().getController("${className}accountNumberField"),
labelText: "Account Number",
hintText: "Enter your account number",
),
controller.selectRecipientDetailField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}selectRecipientDetailField"),
controller: FormFieldConstants.instance().getController("${className}selectRecipientDetailField"),
@ -103,7 +103,7 @@ class NewBeneficiaryView extends GetView<NewBeneficiaryController> {
children: [
GestureDetector(
onTap: () {
// controller.scanQr();
controller.scanQr();
},
child: const Icon(Icons.qr_code, size: 25, color: AppColors.colorPrimary)),
const SizedBox(
@ -124,10 +124,10 @@ class NewBeneficiaryView extends GetView<NewBeneficiaryController> {
],
),
),
// readOnly: true,
// showCursor: false,
readOnly: true,
showCursor: false,
onClick: () {
// controller.selectContact();
controller.selectContact();
},
)),
const SizedBox(width: 10),
@ -170,10 +170,10 @@ class NewBeneficiaryView extends GetView<NewBeneficiaryController> {
onChanged: (val) {
controller.recipientCardNameField.clear();
},
// readOnly: true,
// showCursor: false,
readOnly: true,
showCursor: false,
onClick: () {
// controller.selectContact();
controller.selectContact();
},
)),
const SizedBox(width: 10),
@ -215,19 +215,19 @@ class NewBeneficiaryView extends GetView<NewBeneficiaryController> {
labelText: "Nick Name",
hintText: "Enter your nick name",
),
// controller.emailIDField = InputField(
// refKey: FormFieldConstants.instance().getFormKey("${className}emailIDField"),
// controller: FormFieldConstants.instance().getController("${className}emailIDField"),
// labelText: "Email ID",
// hintText: "Enter your email id",
// ),
// controller.phoneNumberField = InputField(
// refKey: FormFieldConstants.instance().getFormKey("${className}phoneNumberField"),
// controller: FormFieldConstants.instance().getController("${className}phoneNumberField"),
// labelText: "Phone Number",
// keyboardType: TextInputType.number,
// hintText: "Enter your phone number",
// ),
controller.emailIDField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}emailIDField"),
controller: FormFieldConstants.instance().getController("${className}emailIDField"),
labelText: "Email ID",
hintText: "Enter your email id",
),
controller.phoneNumberField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}phoneNumberField"),
controller: FormFieldConstants.instance().getController("${className}phoneNumberField"),
labelText: "Phone Number",
keyboardType: TextInputType.number,
hintText: "Enter your phone number",
),
],
);
}),

@ -50,20 +50,20 @@ class ChangePasswordController extends GetxController {
return;
}
// ServerResponse response = await repository.changePassword(
// ChangePasswordParams(
// newPassword: newPasswordField.getCustomText(),
// oldPassword: oldPasswordField.getCustomText(),
// email: SessionCache.instance.userInfo.cmpUserId,
// ),
// );
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
ServerResponse response = await repository.changePassword(
ChangePasswordParams(
newPassword: newPasswordField.getCustomText(),
oldPassword: oldPasswordField.getCustomText(),
email: SessionCache.instance.userInfo.cmpUserId,
),
);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
CustomDialog.showSuccessDialog(
// title: "Change Password",
title: "Change Password",
description: " Password has been changed successfully",
onTapPositive: () {
clearFields();

@ -72,27 +72,6 @@ class ChangePasswordScreen extends GetView<ChangePasswordController> {
buttonPadding: const EdgeInsets.symmetric(vertical: 8, horizontal: 0),
),
),
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
// child: SizedBox(
// width: double.infinity,
// child: ElevatedButton(
// onPressed: () {
// Get.find<ChangePasswordController>().changePassword();
// },
// style: ElevatedButton.styleFrom(
// backgroundColor: AppColors.colorButton,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(50),
// ),
// ),
// child: Padding(
// padding: const EdgeInsets.all(12.0),
// child: Text(TranslationKeys.makeTranslation(TranslationKeys.textChangePassword), style: Theme.of(context).textTheme.labelMedium?.copyWith(color: AppColors.white)),
// ),
// ),
// ),
// ),
],
persistentFooterAlignment: AlignmentDirectional.bottomCenter,
resizeToAvoidBottomInset: false,

@ -39,26 +39,26 @@ class RecipientDetailsController extends GetxController {
}
Future<void> sendTransaction() async {
// ServerResponse response = await repository
// .sendTransactionStep2(transactionSubmitRequestModel.value);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
//
// TransactionSubmitResponseModel responseModel =
// TransactionSubmitResponseModel.fromMap(response.response);
//
// transitionUpdate.value++;
//
// dp("Transition value is", transitionUpdate.value);
ServerResponse response = await repository
.sendTransactionStep2(transactionSubmitRequestModel.value);
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
// CustomDialog.showTransactionSuccessDialog(
// context,
// responseModel.mbmBkmsbalance.toString(),
// exchangeRate,
// transactionSubmitRequestModel.value,
// );
TransactionSubmitResponseModel responseModel =
TransactionSubmitResponseModel.fromMap(response.response);
transitionUpdate.value++;
dp("Transition value is", transitionUpdate.value);
CustomDialog.showTransactionSuccessDialog(
context,
responseModel.mbmBkmsbalance.toString(),
exchangeRate,
transactionSubmitRequestModel.value,
);
Get.offAllNamed(Routes.DASHBOARD_SCREEN);
}
}

@ -18,6 +18,7 @@ import 'package:uco_mobile_poc/app/res/app_colors.dart';
import 'package:uco_mobile_poc/app/routes/app_pages.dart';
import '../../../core/data/repositories/app_repositories.dart';
import '../../../models/reverse_transaction_model.dart';
import '../../../models/u_recived_responce_model.dart';
import '../../dashboard/controllers/dashboard_screen_controller.dart';
@ -33,7 +34,7 @@ class UReceivedController extends GetxController {
TextEditingController referenceCodeController = TextEditingController();
// late InputField userTransactionPinField;
late InputField userTransactionPinField;
RxList<DropDown> allDepositAccounts = RxList.empty();
Rx<DepositAccount> selectedDepositAccount = DepositAccount.empty().obs;
@ -267,11 +268,11 @@ class UReceivedController extends GetxController {
/// Reverse transaction method
Future<void> reverseTransactionRequest(String sgtSentGntrnumber, String sgtSentNodeId) async {
// ReverseTransactionModel request = ReverseTransactionModel(
// porOrgacode: SessionCache.instance.userInfo.porOrgacode,
// nodeId: sgtSentNodeId,
// sgtGntrnumber: sgtSentGntrnumber,
// );
ReverseTransactionModel request = ReverseTransactionModel(
porOrgacode: SessionCache.instance.userInfo.porOrgacode,
nodeId: sgtSentNodeId,
sgtGntrnumber: sgtSentGntrnumber,
);
ServerResponse response = await repository.reverseTransaction(sgtSentNodeId, sgtSentGntrnumber);
if (response.isError) {
@ -340,7 +341,7 @@ class UReceivedController extends GetxController {
buttonText: TranslationKeys.makeTranslation(TranslationKeys.textContinue),
buttonPadding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
buttonColor: AppColors.colorButton,
//sideBorder: const BorderSide(color: AppColors.colorBorderSkipBtn, width: 1.0),
sideBorder: const BorderSide(color: AppColors.colorBorderSkipBtn, width: 1.0),
),
),
],

@ -93,14 +93,14 @@ class UReceivedView extends GetView<UReceivedController> {
),
title: Text(data.drmbmBkmstitle ?? "-", style: Theme.of(context).textTheme.labelMedium),
children: [
// Text("${data.drPcrCurrshort} ${data.sgtGntramt}", style: Theme.of(context).textTheme.titleSmall?.copyWith(color: AppColors.colorButton)),
// const SizedBox(height: 5),
// Row(
// children: [
// Text("Memo: ", style: Theme.of(context).textTheme.labelSmall),
// Text(data..toString(), style: Theme.of(context).textTheme.labelSmall),
// ],
// ),
Text("${data.drPcrCurrshort} ${data.sgtGntramt}", style: Theme.of(context).textTheme.titleSmall?.copyWith(color: AppColors.colorButton)),
const SizedBox(height: 5),
Row(
children: [
Text("Memo: ", style: Theme.of(context).textTheme.labelSmall),
Text(data.toString(), style: Theme.of(context).textTheme.labelSmall),
],
),
const SizedBox(height: 5),
Row(
children: [

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_contacts/contact.dart';
// import 'package:flutter_contacts/contact.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart';
@ -50,7 +51,7 @@ class USendController extends GetxController {
DropDown selectedCurrency = DropDown.empty();
RxString currencySymbol = "".obs;
// Contact? selectedContact;
Contact? selectedContact;
ExchangeRate? selectedExchangeRate;
String receiverAccountNumber = "";
String receiverAccountTitle = "";
@ -59,7 +60,7 @@ class USendController extends GetxController {
late InputField depositAccountField;
late InputField selectRecipientDetailField;
// late InputField selectCurrencyField;
late InputField selectCurrencyField;
late InputField identityPhoneNumberField;
late InputField identityEmailField;
late InputField recipientCardNameField;
@ -69,28 +70,28 @@ class USendController extends GetxController {
late InputField userTransactionPinField;
late InputField referenceCodeField;
// @override
// void onInit() {
// super.onInit();
//
// for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) {
// DepositAccount depositAccount = SessionCache.instance.depositAccountList.elementAt(i);
//
// allDepositAccounts.add(DropDown(i.toString(), "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", depositAccount));
// }
//
// selectedDepositAccount.value = allDepositAccounts.first.data;
//
// allRecipientDetailOptions.value = <DropDown>[
// DropDown(OPTION_PHONE, TranslationKeys.makeTranslation(TranslationKeys.textPhoneNumber)),
// DropDown(OPTION_EMAIL, TranslationKeys.makeTranslation(TranslationKeys.textEmail)),
// ];
//
// for (int i = 0; i < SessionCache.instance.exchangeRateList.length; i++) {
// ExchangeRate exchangeRate = SessionCache.instance.exchangeRateList.elementAt(i);
// allCurrencieList.add(DropDown(exchangeRate.pcrCurrcode, exchangeRate.pcrCurrdesc, exchangeRate));
// }
// }
@override
void onInit() {
super.onInit();
for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) {
DepositAccount depositAccount = SessionCache.instance.depositAccountList.elementAt(i);
allDepositAccounts.add(DropDown(i.toString(), "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", depositAccount));
}
selectedDepositAccount.value = allDepositAccounts.first.data;
allRecipientDetailOptions.value = <DropDown>[
DropDown(OPTION_PHONE, TranslationKeys.makeTranslation(TranslationKeys.textPhoneNumber)),
DropDown(OPTION_EMAIL, TranslationKeys.makeTranslation(TranslationKeys.textEmail)),
];
for (int i = 0; i < SessionCache.instance.exchangeRateList.length; i++) {
ExchangeRate exchangeRate = SessionCache.instance.exchangeRateList.elementAt(i);
allCurrencieList.add(DropDown(exchangeRate.pcrCurrcode, exchangeRate.pcrCurrdesc, exchangeRate));
}
}
@override
Future<void> onReady() async {
@ -108,7 +109,7 @@ class USendController extends GetxController {
void disposeAllResources() {
depositAccountField.clear();
selectRecipientDetailField.clear();
// selectCurrencyField.clear();
selectCurrencyField.clear();
identityPhoneNumberField.clear();
identityEmailField.clear();
recipientCardNameField.clear();
@ -145,10 +146,10 @@ class USendController extends GetxController {
Future<void> selectContact() async {
dynamic result = await Get.toNamed(Routes.CONTACTS_SCREEN);
// if ((result != null && result[AppConstants.SELECTED_CONTACT] != null)) {
// selectedContact = result[AppConstants.SELECTED_CONTACT];
// identityPhoneNumberField.setText(AppUtils.formatPhoneNumber(selectedContact!.phones.first.number) /*"${selectedContact!.displayName} (${AppUtils.formatPhoneNumber(selectedContact!.phones.first.number + ")")}"*/);
// }
if ((result != null && result[AppConstants.SELECTED_CONTACT] != null)) {
selectedContact = result[AppConstants.SELECTED_CONTACT];
identityPhoneNumberField.setText(AppUtils.formatPhoneNumber(selectedContact!.phones.first.number) /*"${selectedContact!.displayName} (${AppUtils.formatPhoneNumber(selectedContact!.phones.first.number + ")")}"*/);
}
}
bool validate() {
@ -177,38 +178,36 @@ class USendController extends GetxController {
}
Future<void> sendTransaction({navigate = true}) async {
//
// if (!validate()) {
// Toasty.error("Please input and then proceed");
// return;
// }
// TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel(
// porOrgacode: RequestConstants.porOrgacode,
// pctCstycode: RequestConstants.pctCstycode,
// channelCode: RequestConstants.channelCode,
// cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
// drMbmBkmsnumber: selectedDepositAccount.value.mbmBkmsnumber,
// drMbmBkmstitle: selectedDepositAccount.value.mbmBkmstitle,
// drPcrCurrcode: selectedDepositAccount.value.pcrCurrcode,
// drPcrCurrdesc: selectedDepositAccount.value.pcrCurrdesc,
// drPcrCurrshort: selectedDepositAccount.value.pcrCurrshort,
// crMbmBkmsnumber: receiverAccountNumber,
// crMbmBkmstitle: receiverAccountTitle,
// crPcrCurrcode: selectedExchangeRate!.pcrCurrcode,
// crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
// crPcrCurrshort: selectedExchangeRate!.pcrCurrshort,
// sgtGntrnarration: "",
// dmpProdCode: selectedDepositAccount.value.dmpProdcode,
// transType: "DR",
// notificationId: "",
// transMode: "Online",
// sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()),
// otdTrancomment: messageField.getCustomText(),
// isOtpRequired: false,
// cmpRefcode: referenceCodeField.getCustomText(),
// );
if (!validate()) {
Toasty.error("Please input and then proceed");
return;
}
TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel(
porOrgacode: RequestConstants.porOrgacode,
pctCstycode: RequestConstants.pctCstycode,
channelCode: RequestConstants.channelCode,
cmpCustcode: SessionCache.instance.userInfo.cmpCustcode,
drMbmBkmsnumber: selectedDepositAccount.value.mbmBkmsnumber,
drMbmBkmstitle: selectedDepositAccount.value.mbmBkmstitle,
drPcrCurrcode: selectedDepositAccount.value.pcrCurrcode,
drPcrCurrdesc: selectedDepositAccount.value.pcrCurrdesc,
drPcrCurrshort: selectedDepositAccount.value.pcrCurrshort,
crMbmBkmsnumber: receiverAccountNumber,
crMbmBkmstitle: receiverAccountTitle,
crPcrCurrcode: selectedExchangeRate!.pcrCurrcode,
crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc,
crPcrCurrshort: selectedExchangeRate!.pcrCurrshort,
sgtGntrnarration: "",
dmpProdCode: selectedDepositAccount.value.dmpProdcode,
transType: "DR",
notificationId: "",
transMode: "Online",
sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()),
otdTrancomment: messageField.getCustomText(),
isOtpRequired: false,
cmpRefcode: referenceCodeField.getCustomText(),
);
TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel(
porOrgacode: RequestConstants.porOrgacode,
@ -223,20 +222,20 @@ class USendController extends GetxController {
ServerResponse response = await repository.sendTransactionStep1(transactionPinRequestModel);
// if (response.isError) {
// Toasty.error(response.errorMsg);
// return;
// }
//
// SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
// transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
if (response.isError) {
Toasty.error(response.errorMsg);
return;
}
SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response);
transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString();
if (navigate) {
Get.toNamed(Routes.U_SEND_OTP,
// arguments: {
// AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
// AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(),
// }
arguments: {
AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(),
}
);
} else {
Fluttertoast.showToast(
@ -281,7 +280,7 @@ class USendController extends GetxController {
} else {
identityEmailField.setError(response.errorMsg);
}
// Toasty.error(response.errorMsg);
Toasty.error(response.errorMsg);
return;
}
@ -291,24 +290,24 @@ class USendController extends GetxController {
accountInquiryList = AccountInquiryResponseModel.fromList(responseData);
accountsDialog(accountInquiryList);
// AccountInquiryResponseModel transactionSubmitRequestModel = AccountInquiryResponseModel.fromMap(((response.response ?? {}) as Map<Object?, Object?>).map((key, value) => MapEntry(key.toString(), value)));
AccountInquiryResponseModel transactionSubmitRequestModel = AccountInquiryResponseModel.fromMap(((response.response ?? {}) as Map<Object?, Object?>).map((key, value) => MapEntry(key.toString(), value)));
}
// void scanQr() async {
// Get.put(QrSettingController());
//
// var scanResult = await Get.to(() => const QrScanScreen());
//
// var resultJson = jsonDecode(scanResult);
//
// var accNumber = resultJson["phoneNumber"];
//
// dp("Phone", accNumber);
//
// identityPhoneNumberField.setText(accNumber);
//
// verifyAccountAgainstIt();
// }
void scanQr() async {
Get.put(QrSettingController());
var scanResult = await Get.to(() => const QrScanScreen());
var resultJson = jsonDecode(scanResult);
var accNumber = resultJson["phoneNumber"];
dp("Phone", accNumber);
identityPhoneNumberField.setText(accNumber);
verifyAccountAgainstIt();
}
/// Accounts Dialogs...........u-send
void accountsDialog(List<AccountInquiryResponseModel> accountInquiryList) {

@ -11,6 +11,7 @@ import 'package:uco_mobile_poc/app/custom_widgets/Fields/input_field.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_app_bar.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_button.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_toasty.dart';
import 'package:uco_mobile_poc/app/models/AccountInquiryResponseModel.dart';
import 'package:uco_mobile_poc/app/res/app_colors.dart';
import 'package:uco_mobile_poc/app/routes/app_pages.dart';
@ -97,14 +98,14 @@ class USendView extends GetView<USendController> {
onChanged: (val) {
controller.recipientCardNameField.clear();
},
// isCountryPicker: true,
isCountryPicker: true,
suffixIcon: SizedBox(
width: 70,
child: Row(
children: [
GestureDetector(
onTap: () {
// controller.scanQr();
controller.scanQr();
},
child: const Icon(Icons.qr_code, size: 25, color: AppColors.colorPrimary)),
const SizedBox(
@ -125,10 +126,10 @@ class USendView extends GetView<USendController> {
],
),
),
// readOnly: true,
// showCursor: false,
readOnly: true,
showCursor: false,
onClick: () {
// controller.selectContact();
controller.selectContact();
},
)),
const SizedBox(width: 10),
@ -171,10 +172,10 @@ class USendView extends GetView<USendController> {
onChanged: (val) {
controller.recipientCardNameField.clear();
},
// readOnly: true,
// showCursor: false,
readOnly: true,
showCursor: false,
onClick: () {
// controller.selectContact();
controller.selectContact();
},
)),
const SizedBox(width: 10),
@ -209,50 +210,50 @@ class USendView extends GetView<USendController> {
readOnly: true,
showCursor: false,
),
// controller.selectCurrencyField = InputField(
// refKey: FormFieldConstants.instance().getFormKey("${className}selectCurrencyField"),
// controller: FormFieldConstants.instance().getController("${className}selectCurrencyField"),
// labelText: "Select Currency",
// isDropDown: true,
// hintText: "Select currency field",
// dropDownType: DropDownType.SPECIAL,
// items: controller.allCurrencieList,
// onItemSelected: (item) {
// controller.updateSelectedCurrency(item);
// },
// suffixIcon: SizedBox(
// width: 100,
// height: 25,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Image.asset(AppAssets.ic_arrow_down_icon, height: 15, width: 15, color: AppColors.colorGrey500),
// const SizedBox(width: 10),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Container(
// width: 50,
// decoration: const BoxDecoration(
// color: AppColors.colorPrimary,
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(50),
// bottomRight: Radius.circular(50),
// ),
// ),
// child: Center(
// child: Text(
// controller.currencySymbol.value,
// style: const TextStyle(color: AppColors.white, fontSize: 12, fontWeight: FontWeight.w600),
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// ),
controller.selectCurrencyField = InputField(
refKey: FormFieldConstants.instance().getFormKey("${className}selectCurrencyField"),
controller: FormFieldConstants.instance().getController("${className}selectCurrencyField"),
labelText: "Select Currency",
isDropDown: true,
hintText: "Select currency field",
dropDownType: DropDownType.SPECIAL,
items: controller.allCurrencieList,
onItemSelected: (item) {
controller.updateSelectedCurrency(item as AccountInquiryResponseModel);
},
suffixIcon: SizedBox(
width: 100,
height: 25,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(AppAssets.ic_arrow_down_icon, height: 15, width: 15, color: AppColors.colorGrey500),
const SizedBox(width: 10),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 50,
decoration: const BoxDecoration(
color: AppColors.colorPrimary,
borderRadius: BorderRadius.only(
topRight: Radius.circular(50),
bottomRight: Radius.circular(50),
),
),
child: Center(
child: Text(
controller.currencySymbol.value,
style: const TextStyle(color: AppColors.white, fontSize: 12, fontWeight: FontWeight.w600),
),
),
),
],
),
],
),
),
),
Row(
children: [
Expanded(

@ -45,15 +45,15 @@ class USendOtpController extends GetxController {
return;
}
// transactionSubmitRequestModel.pinType = "TRAN";
//
// transactionSubmitRequestModel.obpPincode = pinPutController.text;
transactionSubmitRequestModel.pinType = "TRAN";
transactionSubmitRequestModel.obpPincode = pinPutController.text;
Get.toNamed(Routes.RECIPIENT_DETAILS,
// arguments: {
// AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
// AppConstants.EXCHANGE_RATE: exchangeRate,
// }
arguments: {
AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel,
AppConstants.EXCHANGE_RATE: exchangeRate,
}
);
}

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:image/image.dart' as img;
import 'package:share_plus/share_plus.dart';
// import 'package:image_picker/image_picker.dart';
@ -62,13 +63,13 @@ class UserProfileController extends GetxController {
super.onInit();
/// Deposit accounts assign to Drop Down list
// for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) {
// DepositAccount depositAccount = SessionCache.instance.depositAccountList.elementAt(i);
// dp("=========Desposit All accounts============", depositAccount.toString());
// allDepositAccounts.add(
// DropDown(i.toString(), "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", depositAccount),
// );
// }
for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) {
DepositAccount depositAccount = SessionCache.instance.depositAccountList.elementAt(i);
dp("=========Desposit All accounts============", depositAccount.toString());
allDepositAccounts.add(
DropDown(i.toString(), "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", depositAccount),
);
}
}
void uploadUserProfilePicture() async {
@ -112,7 +113,7 @@ class UserProfileController extends GetxController {
Get.to(() => const AccountDetailsView());
} else if (title == meuType.inviteFriends) {
//
// Share.share("UCO Digital - Apps on Google Play");
Share.share("UCO Digital - Apps on Google Play");
} else if (title == meuType.changePass) {
Get.toNamed(Routes.changePassword);
}

Loading…
Cancel
Save