|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
@ -26,6 +28,16 @@ class HabibWalletPage extends StatefulWidget {
|
|
|
|
class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
late HabibWalletViewModel habibWalletVM;
|
|
|
|
late HabibWalletViewModel habibWalletVM;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void initState() {
|
|
|
|
|
|
|
|
scheduleMicrotask(() async {
|
|
|
|
|
|
|
|
habibWalletVM.initHabibWalletProvider();
|
|
|
|
|
|
|
|
habibWalletVM.getPatientBalanceAmount();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
habibWalletVM = Provider.of<HabibWalletViewModel>(context, listen: false);
|
|
|
|
habibWalletVM = Provider.of<HabibWalletViewModel>(context, listen: false);
|
|
|
|
@ -44,7 +56,7 @@ class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
height: 180.h,
|
|
|
|
height: 180.h,
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
color: AppColors.blackBgColor,
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
borderRadius: 24,
|
|
|
|
borderRadius: 24,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
@ -59,18 +71,18 @@ class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
"${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: AppColors.whiteColor),
|
|
|
|
"${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: AppColors.textColor),
|
|
|
|
"MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(weight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
"MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(weight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h),
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h, applyThemeColor: false),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
LocaleKeys.balanceAmount.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.whiteColor),
|
|
|
|
LocaleKeys.balanceAmount.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.textColor),
|
|
|
|
SizedBox(height: 4.h),
|
|
|
|
SizedBox(height: 4.h),
|
|
|
|
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
|
|
|
|
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
|
|
|
|
return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, textColor: AppColors.whiteColor, iconColor: AppColors.whiteColor, iconSize: 13, isExpanded: false)
|
|
|
|
return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 16, isExpanded: false)
|
|
|
|
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h);
|
|
|
|
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -86,7 +98,7 @@ class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
icon: AppAssets.recharge_icon,
|
|
|
|
icon: AppAssets.recharge_icon,
|
|
|
|
iconSize: 24.w,
|
|
|
|
iconSize: 24.w,
|
|
|
|
backgroundColor: AppColors.infoColor,
|
|
|
|
backgroundColor: AppColors.infoColor,
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
textColor: Colors.white,
|
|
|
|
text: LocaleKeys.recharge.tr(context: context),
|
|
|
|
text: LocaleKeys.recharge.tr(context: context),
|
|
|
|
borderWidth: 0.w,
|
|
|
|
borderWidth: 0.w,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -99,12 +111,42 @@ class _HabibWalletState extends State<HabibWalletPage> {
|
|
|
|
page: RechargeWalletPage(),
|
|
|
|
page: RechargeWalletPage(),
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.then((val) {
|
|
|
|
.then((val) {
|
|
|
|
|
|
|
|
habibWalletVM.initHabibWalletProvider();
|
|
|
|
habibWalletVM.getPatientBalanceAmount();
|
|
|
|
habibWalletVM.getPatientBalanceAmount();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
|
|
|
hasShadow: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
|
|
|
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
|
|
|
itemCount: habibWalletVM.habibWalletBalanceList.length,
|
|
|
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(top: 8, bottom: 8),
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(child: habibWalletVM.habibWalletBalanceList[index].projectDescription!.toText16(weight: FontWeight.w500, color: AppColors.textColor)),
|
|
|
|
|
|
|
|
Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!, textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 18.h, isExpanded: false, fontSize: 28.f, fontWeight: FontWeight.w500),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingSymmetrical(0, 12.h);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) {
|
|
|
|
|
|
|
|
return Divider(height: 1, color: AppColors.textColor.withAlpha(20));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).paddingSymmetrical(16.h, 24.h).toShimmer2(isShow: habibWalletVM.isWalletAmountLoading);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|