|
|
|
|
@ -31,6 +31,7 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
num walletRechargeAmount = 0;
|
|
|
|
|
String notesText = "";
|
|
|
|
|
bool isWalletAmountToBeLoaded = false;
|
|
|
|
|
bool isLakumInfoToBeLoaded = false;
|
|
|
|
|
|
|
|
|
|
// ── Balance visibility (show/hide like a password field) ──────────────────
|
|
|
|
|
bool isWalletAmountHidden = true;
|
|
|
|
|
@ -55,7 +56,7 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
// On first unhide, fetch the data if not already fetched.
|
|
|
|
|
if (!isLakumPointsHidden && !isLakumInfoFetched) {
|
|
|
|
|
isWalletAmountToBeLoaded = true;
|
|
|
|
|
isLakumInfoToBeLoaded = true;
|
|
|
|
|
getLakumAccountInformation();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -358,6 +359,8 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
if (isWalletAmountToBeLoaded) {
|
|
|
|
|
isWalletAmountLoading = true;
|
|
|
|
|
habibWalletAmount = 0;
|
|
|
|
|
}
|
|
|
|
|
if (isLakumInfoToBeLoaded) {
|
|
|
|
|
isLakumAccountInfoLoading = true;
|
|
|
|
|
yahalaAccountNumber = "";
|
|
|
|
|
}
|
|
|
|
|
@ -429,6 +432,11 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setIsLakumInfoToBeLoaded(bool value) {
|
|
|
|
|
isLakumInfoToBeLoaded = value;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getSelectedRechargeTypeValue() {
|
|
|
|
|
switch (selectedRechargeType) {
|
|
|
|
|
case 1:
|
|
|
|
|
@ -571,7 +579,7 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getLakumAccountInformation({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
if (!isWalletAmountToBeLoaded) {
|
|
|
|
|
if (!isLakumInfoToBeLoaded) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -586,6 +594,8 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
(failure) async {
|
|
|
|
|
yahalaAccountNumber = "0";
|
|
|
|
|
isLakumAccountInfoLoading = false;
|
|
|
|
|
isLakumInfoFetched = true;
|
|
|
|
|
isLakumInfoToBeLoaded = false;
|
|
|
|
|
notifyListeners(); // 675534
|
|
|
|
|
},
|
|
|
|
|
(apiResponse) async {
|
|
|
|
|
@ -613,6 +623,7 @@ class HabibWalletViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
isLakumAccountInfoLoading = false;
|
|
|
|
|
isLakumInfoFetched = true;
|
|
|
|
|
isLakumInfoToBeLoaded = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
if (onSuccess != null) {
|
|
|
|
|
onSuccess(apiResponse);
|
|
|
|
|
|