Merge branch 'development_sikander' into 'master'

Development sikander

See merge request mirza.shafique/mohem_flutter_app!38
merge-requests/1/merge
Sikander Saleem 2 years ago
commit 8a3c964664

@ -161,14 +161,14 @@ class Utils {
return base64Decode(base64String);
}
static Widget tableColumnTitle(String? text, {bool showDivider = true}) {
static Widget tableColumnTitle(String? text, {bool showDivider = true, bool alignCenter = false}) {
text ??= "";
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
6.height,
text.toText12(),
alignCenter ? text.toText12().center : text.toText12(),
5.height,
if (showDivider)
const Divider(
@ -180,20 +180,17 @@ class Utils {
);
}
static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true}) {
static Widget tableColumnValue(String text, { bool isCapitable = true, bool alignCenter = false}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
12.height,
(isCapitable ? text.toLowerCase().capitalizeFirstofEach : text).toText12(color: MyColors.normalTextColor),
if (alignCenter)
(isCapitable ? text.toLowerCase().capitalizeFirstofEach : text).toText12(color: MyColors.normalTextColor).center
else
(isCapitable ? text.toLowerCase().capitalizeFirstofEach : text).toText12(color: MyColors.normalTextColor),
12.height,
if (!isLast)
const Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
],
);
}

@ -99,8 +99,9 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.month.tr().toText17(isBold: true, color: MyColors.darkIconColor),
Container(alignment: Alignment.centerLeft, child: LocaleKeys.month.tr().toText17(isBold: true, color: MyColors.darkIconColor)),
if (selectedMonthIndex != null)
Row(
children: [
@ -158,15 +159,15 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
TableRow(
children: [
Utils.tableColumnTitle(LocaleKeys.particular.tr()),
Utils.tableColumnTitle(LocaleKeys.amount.tr()),
Utils.tableColumnTitle(LocaleKeys.amount.tr(), alignCenter: true),
],
),
);
for (int i = 0; i < earningList.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue('${earningList[i].eLEMENTNAME}', isLast: i == earningList.length - 1),
Utils.tableColumnValue('${earningList[i].aMOUNT}', isLast: i == earningList.length - 1),
Utils.tableColumnValue('${earningList[i].eLEMENTNAME}'),
Utils.tableColumnValue('${earningList[i].aMOUNT}', alignCenter: true),
]),
);
}
@ -190,15 +191,15 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
TableRow(
children: [
Utils.tableColumnTitle(LocaleKeys.particular.tr()),
Utils.tableColumnTitle(LocaleKeys.amount.tr()),
Utils.tableColumnTitle(LocaleKeys.amount.tr(), alignCenter: true),
],
),
);
for (int i = 0; i < deductionList.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue('${deductionList[i].eLEMENTNAME}', isLast: i == deductionList.length - 1),
Utils.tableColumnValue('${deductionList[i].aMOUNT}', isLast: i == deductionList.length - 1),
Utils.tableColumnValue('${deductionList[i].eLEMENTNAME}'),
Utils.tableColumnValue('${deductionList[i].aMOUNT}', alignCenter: true),
]),
);
}
@ -223,31 +224,31 @@ class _MonthlyPaySlipScreenState extends State<MonthlyPaySlipScreen> {
TableRow(
children: [
Utils.tableColumnTitle(LocaleKeys.particular.tr()),
Utils.tableColumnTitle("%"),
Utils.tableColumnTitle(LocaleKeys.amount.tr()),
Utils.tableColumnTitle("%", alignCenter: true),
Utils.tableColumnTitle(LocaleKeys.amount.tr(), alignCenter: true),
],
),
);
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(LocaleKeys.deductions.tr(), isLast: false),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALDEDUCTIONSPERCENTAGE}', isLast: false),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALDEDUCTIONSAMOUNT}', isLast: false),
Utils.tableColumnValue(LocaleKeys.deductions.tr()),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALDEDUCTIONSPERCENTAGE}', alignCenter: true),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALDEDUCTIONSAMOUNT}', alignCenter: true),
]),
);
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(LocaleKeys.earnings.tr(), isLast: false),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALEARNINGSPERCENTAGE}', isLast: false),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALEARNINGSAMOUNT}', isLast: false),
Utils.tableColumnValue(LocaleKeys.earnings.tr()),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALEARNINGSPERCENTAGE}', alignCenter: true),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALEARNINGSAMOUNT}', alignCenter: true),
]),
);
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(LocaleKeys.totalPayAmount.tr(), isLast: true),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALPAYPERCENTAGE}', isLast: true),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALPAYAMOUNT}', isLast: true),
Utils.tableColumnValue(LocaleKeys.totalPayAmount.tr()),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALPAYPERCENTAGE}', alignCenter: true),
Utils.tableColumnValue('${summaryOfPaymentList[0].tOTALPAYAMOUNT}', alignCenter: true),
]),
);

Loading…
Cancel
Save