diff --git a/assets/images/svg/hmg_pharmacy_logo.svg b/assets/images/svg/hmg_pharmacy_logo.svg
new file mode 100644
index 00000000..e069d513
--- /dev/null
+++ b/assets/images/svg/hmg_pharmacy_logo.svg
@@ -0,0 +1,32 @@
+
diff --git a/assets/images/svg/redeem_icon.svg b/assets/images/svg/redeem_icon.svg
new file mode 100644
index 00000000..52eb8815
--- /dev/null
+++ b/assets/images/svg/redeem_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart
index 64074ff8..ed59659d 100644
--- a/lib/core/api/api_client.dart
+++ b/lib/core/api/api_client.dart
@@ -208,7 +208,7 @@ class ApiClientImp implements ApiClient {
body['TokenID'] = "@dm!n";
}
- // body['TokenID'] = "@dm!n";
+ body['TokenID'] = "@dm!n";
// body['PatientID'] = 1018977;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index 74fa0ee7..301cb31c 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -281,7 +281,7 @@ class ApiConsts {
static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations";
// ************ static values for Api ****************
- static final double appVersionID = 21.1;
+ static final double appVersionID = 21.2;
// static final double appVersionID = 50.7;
static final int appChannelId = 3;
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 2612bde9..7f8e175c 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -377,6 +377,8 @@ class AppAssets {
static const String gallery = '$svgBasePath/gallery.svg';
static const String files = '$svgBasePath/files.svg';
static const String online_checkin_icon = '$svgBasePath/online_checkin_icon.svg';
+ static const String hmg_pharmacy_logo = '$svgBasePath/hmg_pharmacy_logo.svg';
+ static const String redeem_icon = '$svgBasePath/redeem_icon.svg';
//Health Calculators
static const String bodyfatcalc = '$svgBasePath/bfc.svg';
@@ -427,8 +429,6 @@ class AppAssets {
static const String bmiFullBodyFemale = '$pngBasePath/female_bmi.png';
static const String defaultMEP = '$pngBasePath/default_MEP.png';
-
-
static const String ambulance_section = '$pngBasePath/ambulance_section.png';
static const String rrt_section = '$pngBasePath/rrt_section.png';
static const String er_checkin = '$pngBasePath/er_checkin.png';
diff --git a/lib/features/habib_wallet/habib_wallet_repo.dart b/lib/features/habib_wallet/habib_wallet_repo.dart
index c89a85be..57d5af20 100644
--- a/lib/features/habib_wallet/habib_wallet_repo.dart
+++ b/lib/features/habib_wallet/habib_wallet_repo.dart
@@ -18,6 +18,10 @@ abstract class HabibWalletRepo {
Future>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference});
Future>> getPatientInfoByPatientID({required String patientID});
+
+ Future>> getLakumAccountInformation({required String identificationNumber});
+
+ Future>> getLakumAccountInquiryInformation({required String lakumAccountNumber});
}
class HabibWalletRepoImp implements HabibWalletRepo {
@@ -231,4 +235,75 @@ class HabibWalletRepoImp implements HabibWalletRepo {
return Left(UnknownFailure(e.toString()));
}
}
+
+ @override
+ Future> getLakumAccountInformation({required String identificationNumber}) async {
+ Map requestBody = {"IdentificationNo": identificationNumber};
+
+ try {
+ GenericApiModel? apiResponse;
+ Failure? failure;
+ await apiClient.post(
+ GET_LACUM_ACCOUNT_INFORMATION,
+ body: requestBody,
+ onFailure: (error, statusCode, {messageStatus, failureType}) {
+ failure = failureType;
+ },
+ onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
+ try {
+ apiResponse = GenericApiModel(
+ messageStatus: messageStatus,
+ statusCode: statusCode,
+ errorMessage: null,
+ data: response,
+ );
+ } catch (e) {
+ failure = DataParsingFailure(e.toString());
+ }
+ },
+ );
+ if (failure != null) return Left(failure!);
+ if (apiResponse == null) return Left(ServerFailure("Unknown error"));
+ return Right(apiResponse!);
+ } catch (e) {
+ return Left(UnknownFailure(e.toString()));
+ }
+ }
+
+ @override
+ Future> getLakumAccountInquiryInformation({required String lakumAccountNumber}) async {
+ Map requestBody = {
+ "AccountNumber": lakumAccountNumber,
+ "IsDetailsRequired": true,
+ };
+
+ try {
+ GenericApiModel? apiResponse;
+ Failure? failure;
+ await apiClient.post(
+ GET_LACUM_GROUP_INFORMATION,
+ body: requestBody,
+ onFailure: (error, statusCode, {messageStatus, failureType}) {
+ failure = failureType;
+ },
+ onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
+ try {
+ apiResponse = GenericApiModel(
+ messageStatus: messageStatus,
+ statusCode: statusCode,
+ errorMessage: null,
+ data: response,
+ );
+ } catch (e) {
+ failure = DataParsingFailure(e.toString());
+ }
+ },
+ );
+ if (failure != null) return Left(failure!);
+ if (apiResponse == null) return Left(ServerFailure("Unknown error"));
+ return Right(apiResponse!);
+ } catch (e) {
+ return Left(UnknownFailure(e.toString()));
+ }
+ }
}
diff --git a/lib/features/habib_wallet/habib_wallet_view_model.dart b/lib/features/habib_wallet/habib_wallet_view_model.dart
index 01dc2357..a99c8351 100644
--- a/lib/features/habib_wallet/habib_wallet_view_model.dart
+++ b/lib/features/habib_wallet/habib_wallet_view_model.dart
@@ -1,6 +1,9 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:hmg_patient_app_new/core/app_state.dart';
+import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_repo.dart';
+import 'package:hmg_patient_app_new/features/habib_wallet/models/lakum_inquiry_information_response_model.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/models/patient_advance_balance_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
@@ -43,6 +46,8 @@ class HabibWalletViewModel extends ChangeNotifier {
String? get hospitalError => _hospitalError;
String yahalaAccountNumber = '';
+ bool isLakumAccountInfoLoading = false;
+ late LakumInquiryInformationResponseModel lakumAccountInfo;
// Clear amount error
void clearAmountError() {
@@ -103,6 +108,7 @@ class HabibWalletViewModel extends ChangeNotifier {
initHabibWalletProvider() {
isWalletAmountLoading = true;
isBottomSheetContentLoading = false;
+ isLakumAccountInfoLoading = true;
habibWalletAmount = 0;
walletRechargeAmount = 0;
selectedRechargeType = 1;
@@ -112,6 +118,7 @@ class HabibWalletViewModel extends ChangeNotifier {
fileNumber = '';
depositorName = '';
mobileNumber = '';
+ yahalaAccountNumber = "";
notifyListeners();
}
@@ -148,6 +155,11 @@ class HabibWalletViewModel extends ChangeNotifier {
notifyListeners();
}
+ setYahalaAccountNumber(String accountNumber) {
+ yahalaAccountNumber = accountNumber;
+ notifyListeners();
+ }
+
String getSelectedRechargeTypeValue() {
switch (selectedRechargeType) {
case 1:
@@ -277,4 +289,45 @@ class HabibWalletViewModel extends ChangeNotifier {
},
);
}
+
+ Future getLakumAccountInformation({Function(dynamic)? onSuccess, Function(String)? onError}) async {
+ isLakumAccountInfoLoading = true;
+ notifyListeners();
+
+ final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get().getAuthenticatedUser()!.patientIdentificationNo ?? "");
+
+ result.fold(
+ (failure) async => await errorHandlerService.handleError(failure: failure),
+ (apiResponse) async {
+ if (apiResponse.messageStatus == 2) {
+ yahalaAccountNumber = "0";
+ isLakumAccountInfoLoading = false;
+ notifyListeners();
+ } else if (apiResponse.messageStatus == 1) {
+ if (apiResponse.data["YahalaAccountNo"] == 0 || apiResponse.data["YahalaAccountNo"] == "0") {
+ yahalaAccountNumber = "0";
+ } else {
+ yahalaAccountNumber = apiResponse.data["YahalaAccountNo"].toString();
+
+ final lakumAccountResult = await habibWalletRepo.getLakumAccountInquiryInformation(lakumAccountNumber: yahalaAccountNumber);
+ lakumAccountResult.fold(
+ (failure) async => await errorHandlerService.handleError(failure: failure),
+ (lakumApiResponse) async {
+ if (lakumApiResponse.messageStatus == 2) {
+ lakumAccountInfo = LakumInquiryInformationResponseModel();
+ } else if (lakumApiResponse.messageStatus == 1) {
+ lakumAccountInfo = LakumInquiryInformationResponseModel.fromJson(lakumApiResponse.data["LakumInquiryInformationObjVersion"]);
+ }
+ },
+ );
+ }
+ isLakumAccountInfoLoading = false;
+ notifyListeners();
+ if (onSuccess != null) {
+ onSuccess(apiResponse);
+ }
+ }
+ },
+ );
+ }
}
diff --git a/lib/features/habib_wallet/models/lakum_inquiry_information_response_model.dart b/lib/features/habib_wallet/models/lakum_inquiry_information_response_model.dart
new file mode 100644
index 00000000..621434fe
--- /dev/null
+++ b/lib/features/habib_wallet/models/lakum_inquiry_information_response_model.dart
@@ -0,0 +1,318 @@
+class LakumInquiryInformationResponseModel {
+ int? accountNumber;
+ String? accountStatus;
+ String? barCode;
+ num? consumedPoints;
+ dynamic consumedPointsAmount;
+ dynamic consumedPointsAmountPerYear;
+
+ // List? consumedPointsDetails;
+ String? createdDate;
+ num? expiredPoints;
+ String? expiryDate;
+ num? gainedPoints;
+ num? gainedPointsAmount;
+ List? gainedPointsAmountPerYear;
+
+ // List? gainedPointsDetails;
+ String? lakumMessageStatus;
+ String? memberName;
+ String? memberUniversalId;
+ String? mobileNumber;
+ num? pointsBalance;
+ num? pointsBalanceAmount;
+ num? pointsWillBeExpired;
+ String? prefLang;
+ num? statusCode;
+ num? transferPoints;
+ dynamic transferPointsAmountPerYear;
+
+ // List? transferPointsDetails;
+ num? waitingPoints;
+ num? loyalityAmount;
+ num? loyalityPoints;
+ num? purchaseRate;
+
+ LakumInquiryInformationResponseModel(
+ {this.accountNumber,
+ this.accountStatus,
+ this.barCode,
+ this.consumedPoints,
+ this.consumedPointsAmount,
+ this.consumedPointsAmountPerYear,
+ // this.consumedPointsDetails,
+ this.createdDate,
+ this.expiredPoints,
+ this.expiryDate,
+ this.gainedPoints,
+ this.gainedPointsAmount,
+ this.gainedPointsAmountPerYear,
+ // this.gainedPointsDetails,
+ this.lakumMessageStatus,
+ this.memberName,
+ this.memberUniversalId,
+ this.mobileNumber,
+ this.pointsBalance,
+ this.pointsBalanceAmount,
+ this.pointsWillBeExpired,
+ this.prefLang,
+ this.statusCode,
+ this.transferPoints,
+ this.transferPointsAmountPerYear,
+ // this.transferPointsDetails,
+ this.waitingPoints,
+ this.loyalityAmount,
+ this.loyalityPoints,
+ this.purchaseRate});
+
+ LakumInquiryInformationResponseModel.fromJson(Map json) {
+ accountNumber = json['AccountNumber'];
+ accountStatus = json['AccountStatus'];
+ barCode = json['BarCode'];
+ consumedPoints = json['ConsumedPoints'];
+ consumedPointsAmount = json['ConsumedPointsAmount'];
+ consumedPointsAmountPerYear = json['ConsumedPointsAmountPerYear'];
+ // if (json['ConsumedPointsDetails'] != null) {
+ // consumedPointsDetails = [];
+ // json['ConsumedPointsDetails'].forEach((v) {
+ // consumedPointsDetails!.add(new Null.fromJson(v));
+ // });
+ // }
+ createdDate = json['CreatedDate'];
+ expiredPoints = json['ExpiredPoints'];
+ expiryDate = json['ExpiryDate'];
+ gainedPoints = json['GainedPoints'];
+ gainedPointsAmount = json['GainedPointsAmount'];
+ if (json['GainedPointsAmountPerYear'] != null) {
+ gainedPointsAmountPerYear = [];
+ json['GainedPointsAmountPerYear'].forEach((v) {
+ gainedPointsAmountPerYear!.add(new GainedPointsAmountPerYear.fromJson(v));
+ });
+ }
+ // if (json['GainedPointsDetails'] != null) {
+ // gainedPointsDetails = [];
+ // json['GainedPointsDetails'].forEach((v) {
+ // gainedPointsDetails!.add(new Null.fromJson(v));
+ // });
+ // }
+ lakumMessageStatus = json['LakumMessageStatus'];
+ memberName = json['MemberName'];
+ memberUniversalId = json['MemberUniversalId'];
+ mobileNumber = json['MobileNumber'];
+ pointsBalance = json['PointsBalance'];
+ pointsBalanceAmount = json['PointsBalanceAmount'];
+ pointsWillBeExpired = json['PointsWillBeExpired'];
+ prefLang = json['PrefLang'];
+ statusCode = json['StatusCode'];
+ transferPoints = json['TransferPoints'];
+ transferPointsAmountPerYear = json['TransferPointsAmountPerYear'];
+ // if (json['TransferPointsDetails'] != null) {
+ // transferPointsDetails = [];
+ // json['TransferPointsDetails'].forEach((v) {
+ // transferPointsDetails!.add(new Null.fromJson(v));
+ // });
+ // }
+ waitingPoints = json['WaitingPoints'];
+ loyalityAmount = json['loyalityAmount'];
+ loyalityPoints = json['loyalityPoints'];
+ purchaseRate = json['purchaseRate'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AccountNumber'] = this.accountNumber;
+ data['AccountStatus'] = this.accountStatus;
+ data['BarCode'] = this.barCode;
+ data['ConsumedPoints'] = this.consumedPoints;
+ data['ConsumedPointsAmount'] = this.consumedPointsAmount;
+ data['ConsumedPointsAmountPerYear'] = this.consumedPointsAmountPerYear;
+ // if (this.consumedPointsDetails != null) {
+ // data['ConsumedPointsDetails'] = this.consumedPointsDetails!.map((v) => v.toJson()).toList();
+ // }
+ data['CreatedDate'] = this.createdDate;
+ data['ExpiredPoints'] = this.expiredPoints;
+ data['ExpiryDate'] = this.expiryDate;
+ data['GainedPoints'] = this.gainedPoints;
+ data['GainedPointsAmount'] = this.gainedPointsAmount;
+ if (this.gainedPointsAmountPerYear != null) {
+ data['GainedPointsAmountPerYear'] = this.gainedPointsAmountPerYear!.map((v) => v.toJson()).toList();
+ }
+ // if (this.gainedPointsDetails != null) {
+ // data['GainedPointsDetails'] = this.gainedPointsDetails!.map((v) => v.toJson()).toList();
+ // }
+ data['LakumMessageStatus'] = this.lakumMessageStatus;
+ data['MemberName'] = this.memberName;
+ data['MemberUniversalId'] = this.memberUniversalId;
+ data['MobileNumber'] = this.mobileNumber;
+ data['PointsBalance'] = this.pointsBalance;
+ data['PointsBalanceAmount'] = this.pointsBalanceAmount;
+ data['PointsWillBeExpired'] = this.pointsWillBeExpired;
+ data['PrefLang'] = this.prefLang;
+ data['StatusCode'] = this.statusCode;
+ data['TransferPoints'] = this.transferPoints;
+ data['TransferPointsAmountPerYear'] = this.transferPointsAmountPerYear;
+ // if (this.transferPointsDetails != null) {
+ // data['TransferPointsDetails'] = this.transferPointsDetails!.map((v) => v.toJson()).toList();
+ // }
+ data['WaitingPoints'] = this.waitingPoints;
+ data['loyalityAmount'] = this.loyalityAmount;
+ data['loyalityPoints'] = this.loyalityPoints;
+ data['purchaseRate'] = this.purchaseRate;
+ return data;
+ }
+}
+
+class GainedPointsAmountPerYear {
+ num? amountPerYear;
+ List? pointsAmountPerMonth;
+ num? pointsPerYear;
+ int? year;
+
+ GainedPointsAmountPerYear({this.amountPerYear, this.pointsAmountPerMonth, this.pointsPerYear, this.year});
+
+ GainedPointsAmountPerYear.fromJson(Map json) {
+ amountPerYear = json['AmountPerYear'];
+ if (json['PointsAmountPerMonth'] != null) {
+ pointsAmountPerMonth = [];
+ json['PointsAmountPerMonth'].forEach((v) {
+ pointsAmountPerMonth!.add(new PointsAmountPerMonth.fromJson(v));
+ });
+ }
+ pointsPerYear = json['PointsPerYear'];
+ year = json['Year'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AmountPerYear'] = this.amountPerYear;
+ if (this.pointsAmountPerMonth != null) {
+ data['PointsAmountPerMonth'] = this.pointsAmountPerMonth!.map((v) => v.toJson()).toList();
+ }
+ data['PointsPerYear'] = this.pointsPerYear;
+ data['Year'] = this.year;
+ return data;
+ }
+}
+
+class PointsAmountPerMonth {
+ num? amountPerMonth;
+ String? month;
+ num? monthNumber;
+ List? pointsAmountPerday;
+ num? pointsPerMonth;
+
+ PointsAmountPerMonth({this.amountPerMonth, this.month, this.monthNumber, this.pointsAmountPerday, this.pointsPerMonth});
+
+ PointsAmountPerMonth.fromJson(Map json) {
+ amountPerMonth = json['AmountPerMonth'];
+ month = json['Month'];
+ monthNumber = json['MonthNumber'];
+ if (json['PointsAmountPerday'] != null) {
+ pointsAmountPerday = [];
+ json['PointsAmountPerday'].forEach((v) {
+ pointsAmountPerday!.add(new PointsAmountPerday.fromJson(v));
+ });
+ }
+ pointsPerMonth = json['PointsPerMonth'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AmountPerMonth'] = this.amountPerMonth;
+ data['Month'] = this.month;
+ data['MonthNumber'] = this.monthNumber;
+ if (this.pointsAmountPerday != null) {
+ data['PointsAmountPerday'] = this.pointsAmountPerday!.map((v) => v.toJson()).toList();
+ }
+ data['PointsPerMonth'] = this.pointsPerMonth;
+ return data;
+ }
+}
+
+class PointsAmountPerday {
+ num? amountPerDay;
+ String? day;
+ List? pointsDetails;
+ num? pointsPerDay;
+ String? transationDate;
+
+ PointsAmountPerday({this.amountPerDay, this.day, this.pointsDetails, this.pointsPerDay, this.transationDate});
+
+ PointsAmountPerday.fromJson(Map json) {
+ amountPerDay = json['AmountPerDay'];
+ day = json['Day'];
+ if (json['PointsDetails'] != null) {
+ pointsDetails = [];
+ json['PointsDetails'].forEach((v) {
+ pointsDetails!.add(new PointsDetails.fromJson(v));
+ });
+ }
+ pointsPerDay = json['PointsPerDay'];
+ transationDate = json['TransationDate'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AmountPerDay'] = this.amountPerDay;
+ data['Day'] = this.day;
+ if (this.pointsDetails != null) {
+ data['PointsDetails'] = this.pointsDetails!.map((v) => v.toJson()).toList();
+ }
+ data['PointsPerDay'] = this.pointsPerDay;
+ data['TransationDate'] = this.transationDate;
+ return data;
+ }
+}
+
+class PointsDetails {
+ int? accNumber;
+ String? accountStatus;
+ num? amount;
+ int? lineItemNo;
+ String? operationType;
+ num? points;
+ num? purchasePoints;
+ int? subTransactionType;
+ String? subTransactionTypeDescription;
+ String? transactionDate;
+
+ PointsDetails(
+ {this.accNumber,
+ this.accountStatus,
+ this.amount,
+ this.lineItemNo,
+ this.operationType,
+ this.points,
+ this.purchasePoints,
+ this.subTransactionType,
+ this.subTransactionTypeDescription,
+ this.transactionDate});
+
+ PointsDetails.fromJson(Map json) {
+ accNumber = json['AccNumber'];
+ accountStatus = json['AccountStatus'];
+ amount = json['Amount'];
+ lineItemNo = json['LineItemNo'];
+ operationType = json['OperationType'];
+ points = json['Points'];
+ purchasePoints = json['PurchasePoints'];
+ subTransactionType = json['SubTransactionType'];
+ subTransactionTypeDescription = json['SubTransactionTypeDescription'];
+ transactionDate = json['TransactionDate'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AccNumber'] = this.accNumber;
+ data['AccountStatus'] = this.accountStatus;
+ data['Amount'] = this.amount;
+ data['LineItemNo'] = this.lineItemNo;
+ data['OperationType'] = this.operationType;
+ data['Points'] = this.points;
+ data['PurchasePoints'] = this.purchasePoints;
+ data['SubTransactionType'] = this.subTransactionType;
+ data['SubTransactionTypeDescription'] = this.subTransactionTypeDescription;
+ data['TransactionDate'] = this.transactionDate;
+ return data;
+ }
+}
diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart
index ae8c6817..0e694d29 100644
--- a/lib/generated/locale_keys.g.dart
+++ b/lib/generated/locale_keys.g.dart
@@ -1838,5 +1838,7 @@ abstract class LocaleKeys {
static const fileSizeExceedsLimit = 'fileSizeExceedsLimit';
static const completedPrescriptionOrder = 'completedPrescriptionOrder';
static const submitEReferral = 'submitEReferral';
+ static const redeem = 'redeem';
+ static const points = 'points';
}
diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart
index 5ea5b96b..6174c166 100644
--- a/lib/presentation/home/landing_page.dart
+++ b/lib/presentation/home/landing_page.dart
@@ -137,6 +137,7 @@ class _LandingPageState extends State {
if (appState.isAuthenticated) {
habibWalletVM.initHabibWalletProvider();
habibWalletVM.getPatientBalanceAmount();
+ habibWalletVM.getLakumAccountInformation();
todoSectionViewModel.initializeTodoSectionViewModel();
immediateLiveCareViewModel.initImmediateLiveCare();
immediateLiveCareViewModel.getPatientLiveCareHistory();
@@ -197,6 +198,7 @@ class _LandingPageState extends State {
// Refresh Appointments Data
habibWalletVM.initHabibWalletProvider();
habibWalletVM.getPatientBalanceAmount();
+ habibWalletVM.getLakumAccountInformation();
// Refresh Ancillary Orders
todoSectionViewModel.initializeTodoSectionViewModel();
diff --git a/lib/presentation/home/widgets/lakum_wallet_card.dart b/lib/presentation/home/widgets/lakum_wallet_card.dart
index e693667c..f8abbeae 100644
--- a/lib/presentation/home/widgets/lakum_wallet_card.dart
+++ b/lib/presentation/home/widgets/lakum_wallet_card.dart
@@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
@@ -15,6 +16,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart';
+import 'package:url_launcher/url_launcher.dart';
class LakumWalletCard extends StatelessWidget {
const LakumWalletCard({super.key});
@@ -84,7 +86,7 @@ class LakumWalletCard extends StatelessWidget {
// ),
// ],
// ),
- SizedBox(height: 4.h),
+ SizedBox(height: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -93,24 +95,19 @@ class LakumWalletCard extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: [
Row(
+ crossAxisAlignment: CrossAxisAlignment.end,
children: [
- Utils.buildSvgWithAssets(
- icon: AppAssets.saudi_riyal_icon,
- iconColor: AppColors.inputLabelTextColor,
- width: 24.h,
- height: 24.h,
- fit: BoxFit.contain,
- ),
- SizedBox(width: 8.h),
NumberFormat.decimalPattern()
- .format(habibWalletVM.habibWalletAmount)
+ .format(habibWalletVM.isLakumAccountInfoLoading ? 123 :habibWalletVM.lakumAccountInfo.pointsBalance)
.toString()
.toText32(isBold: true, isEnglishOnly: true)
- .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h),
+ .toShimmer2(isShow: habibWalletVM.isLakumAccountInfoLoading, radius: 12.h, width: 80.h, height: 40.h),
+ SizedBox(width: 4.h),
+ LocaleKeys.points.tr().toText12(color: AppColors.inputLabelTextColor, isBold: true)
],
),
- // Spacer(),
- Utils.getPaymentMethods(),
+ Spacer(),
+ Utils.buildSvgWithAssets(icon: AppAssets.hmg_pharmacy_logo, width: 32.h, height: 32.h, fit: BoxFit.contain, applyThemeColor: false),
],
);
}),
@@ -123,19 +120,21 @@ class LakumWalletCard extends StatelessWidget {
flex: 6,
child: CustomButton(
height: 40.h,
- icon: AppAssets.recharge_icon,
- iconColor: AppColors.infoColor,
+ icon: AppAssets.redeem_icon,
+ iconColor: AppColors.successColor,
iconSize: 24.h,
- backgroundColor: AppColors.infoColor.withAlpha(15),
- textColor: AppColors.infoColor,
- text: LocaleKeys.recharge.tr(context: context),
+ backgroundColor: AppColors.successColor.withAlpha(15),
+ textColor: AppColors.successColor,
+ text: LocaleKeys.redeem.tr(context: context),
borderWidth: 0.w,
fontWeight: FontWeight.w600,
- borderColor: AppColors.infoColor.withAlpha(15),
+ borderColor: AppColors.successColor.withAlpha(15),
padding: EdgeInsets.fromLTRB(4, 0, 12, 0),
fontSize: 14.f,
onPressed: () {
- Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
+ Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
+ launchUrl(uri, mode: LaunchMode.externalApplication);
+ // Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
},
),
),