|
|
|
|
@ -28,11 +28,13 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
return BaseView<LacumViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
await model.getLacumData();
|
|
|
|
|
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
|
|
|
|
|
if (model.lacumInformation.yahalaAccountNo == 0 ||
|
|
|
|
|
model.lacumInformation.yahalaAccountNo == null) {
|
|
|
|
|
navigateToLakumRegister(context);
|
|
|
|
|
} else {
|
|
|
|
|
if (model.lacumInformation.status == "Hold") {
|
|
|
|
|
Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
|
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
|
context, FadePage(page: LakumActivationVidaPage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -49,7 +51,10 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
body: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null)
|
|
|
|
|
child: (model.lacumGroupInformation != null &&
|
|
|
|
|
model.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion !=
|
|
|
|
|
null)
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
@ -63,7 +68,11 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: mediaQuery.size.height * 0.02,
|
|
|
|
|
),
|
|
|
|
|
Container(width: mediaQuery.size.width * 1, child: LakumBannerWidget(model, mediaQuery, true)),
|
|
|
|
|
Container(
|
|
|
|
|
width: mediaQuery.size.width * 1,
|
|
|
|
|
height: mediaQuery.size.width * .6,
|
|
|
|
|
child: LakumBannerWidget(
|
|
|
|
|
model, mediaQuery, true)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -76,18 +85,44 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 100,
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
|
|
|
|
|
height: 110,
|
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 16, vertical: 12.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null),
|
|
|
|
|
LacumPointsWidget(
|
|
|
|
|
mediaQuery,
|
|
|
|
|
1,
|
|
|
|
|
TranslationBase.of(context).balance,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.pointsBalanceAmount,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.pointsBalance,
|
|
|
|
|
null),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
|
|
|
|
|
LacumPointsWidget(
|
|
|
|
|
mediaQuery,
|
|
|
|
|
2,
|
|
|
|
|
TranslationBase.of(context).gained,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.pointsBalanceAmount,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.gainedPoints,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.gainedPointsAmountPerYear),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
@ -95,16 +130,40 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
mediaQuery,
|
|
|
|
|
3,
|
|
|
|
|
TranslationBase.of(context).consumed,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
|
|
|
|
|
? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.consumedPointsAmount !=
|
|
|
|
|
null
|
|
|
|
|
? int.parse(model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.consumedPointsAmount)
|
|
|
|
|
: 0,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.consumedPoints,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.consumedPointsAmountPerYear),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints,
|
|
|
|
|
model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear),
|
|
|
|
|
LacumPointsWidget(
|
|
|
|
|
mediaQuery,
|
|
|
|
|
4,
|
|
|
|
|
TranslationBase.of(context).transferred,
|
|
|
|
|
0,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.transferPoints,
|
|
|
|
|
model
|
|
|
|
|
.lacumGroupInformation
|
|
|
|
|
.lakumInquiryInformationObjVersion
|
|
|
|
|
.transferPointsAmountPerYear),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -128,7 +187,8 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
@ -143,7 +203,7 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).expiryDate,
|
|
|
|
|
TranslationBase.of(context).expiryPoints,
|
|
|
|
|
// "Expired",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
@ -151,7 +211,7 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints}${TranslationBase.of(context).lakumPoint} ",
|
|
|
|
|
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints} ${TranslationBase.of(context).lakumPoint} ",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
@ -164,39 +224,45 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
|
|
|
|
Row(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: 20,
|
|
|
|
|
height: 25,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).Waitinggained,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: 20,
|
|
|
|
|
height: 25,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.Waitinggained,
|
|
|
|
|
// "Waiting gained",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
])),
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
])),
|
|
|
|
|
// Texts(
|
|
|
|
|
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
@ -249,7 +315,11 @@ class LakumMainPage extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
navigateToLakumRegister(BuildContext context) {
|
|
|
|
|
Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
|
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LakumRegistrationPage(
|
|
|
|
|
projectViewModel.user.patientIdentificationNo)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -259,7 +329,12 @@ List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
|
|
|
|
|
icon: Icon(Icons.settings),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LakumSettingPage(
|
|
|
|
|
model.lacumInformation, model.lacumGroupInformation)))
|
|
|
|
|
.then((result) => {model.getLacumGroupData()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
];
|
|
|
|
|
@ -281,7 +356,9 @@ class LakumHomeButtons extends StatelessWidget {
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
print("Account activate click");
|
|
|
|
|
Navigator.push(context, FadePage(page: LakumActivationVidaPage())).then((result) => {model.getLacumGroupData()});
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context, FadePage(page: LakumActivationVidaPage()))
|
|
|
|
|
.then((result) => {model.getLacumGroupData()});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
@ -324,7 +401,12 @@ class LakumHomeButtons extends StatelessWidget {
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
print("Lacum transfer click");
|
|
|
|
|
Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LacumTransferPage(model.lacumInformation,
|
|
|
|
|
model.lacumGroupInformation)))
|
|
|
|
|
.then((result) => {model.getLacumGroupData()});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
@ -340,7 +422,8 @@ class LakumHomeButtons extends StatelessWidget {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png",
|
|
|
|
|
"assets/images/pharmacy_module/lakum/akum_transfer.png",
|
|
|
|
|
// "assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: 35,
|
|
|
|
|
height: 30,
|
|
|
|
|
@ -375,13 +458,15 @@ class LacumPointsWidget extends StatelessWidget {
|
|
|
|
|
Color titleColor;
|
|
|
|
|
final List<PointsAmountPerYear> pointsAmountPerYear;
|
|
|
|
|
|
|
|
|
|
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {
|
|
|
|
|
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal,
|
|
|
|
|
this.point, this.pointsAmountPerYear) {
|
|
|
|
|
if (pointType == 1) {
|
|
|
|
|
titleColor = Color(0xffefefef);
|
|
|
|
|
} else if (pointType == 2) {
|
|
|
|
|
titleColor = Color(0xff004bcc);
|
|
|
|
|
} else if (pointType == 3) {
|
|
|
|
|
// titleColor = Color(0xff004bcc);
|
|
|
|
|
titleColor = Color(0xff339933);
|
|
|
|
|
} else if (pointType == 3) {
|
|
|
|
|
titleColor = Colors.grey;
|
|
|
|
|
} else {
|
|
|
|
|
titleColor = Color(0xffffa500);
|
|
|
|
|
}
|
|
|
|
|
@ -393,9 +478,11 @@ class LacumPointsWidget extends StatelessWidget {
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (pointType != 1) {
|
|
|
|
|
if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) {
|
|
|
|
|
Navigator.push(context, FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).lakumMsg);
|
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
|
message: TranslationBase.of(context).lakumMsg);
|
|
|
|
|
// show snackBar No Details Points are there
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -410,7 +497,7 @@ class LacumPointsWidget extends StatelessWidget {
|
|
|
|
|
color: Color(0xffe1e1e1),
|
|
|
|
|
width: 0.4,
|
|
|
|
|
)),
|
|
|
|
|
color: pointType == 1 ? Colors.green : Color(0xffefefef),
|
|
|
|
|
color: pointType == 1 ? Color(0xff339933) : Color(0xffefefef),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|