Updates & Fixes

merge-requests/50/head
haroon amjad 3 years ago
parent 868728b876
commit 28a882a2f6

@ -1,20 +1,12 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/menus.dart';
import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/provider/eit_provider_model.dart';
import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart';
import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart';
class MissingSwipe extends StatelessWidget {

@ -62,7 +62,7 @@ class _LeaveBalanceState extends State<LeaveBalance> {
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true),
BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true),
12.height,
absenceTransList == null
? const SizedBox()
@ -76,14 +76,23 @@ class _LeaveBalanceState extends State<LeaveBalance> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""),
ItemDetailView(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""),
ItemDetailView(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""),
ItemDetailView(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""),
ItemDetailView(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""),
ItemDetailView(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""),
ItemDetailView(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""),
ItemDetailView(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""),
ItemDetailViewCol(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""),
ItemDetailViewCol(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""),
isItLast: true,
),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,

@ -62,6 +62,17 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
late bool isTicketRequest;
List<Widget> getEITWidgetsList(List<CollectionTransaction>? collectionTransaction) {
List<Widget> itemsList = [];
for (int t = 0; t < (collectionTransaction ?? []).length; t++) {
if (collectionTransaction![t].dISPLAYFLAG == "Y") {
itemsList.add(ItemDetailViewCol(collectionTransaction[t].sEGMENTPROMPT!, collectionTransaction[t].sEGMENTVALUEDSP ?? ""));
}
}
return itemsList;
}
@override
Widget build(BuildContext context) {
if (dynamicParams == null) {
@ -84,16 +95,45 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
shrinkWrap: true,
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
: GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.9 / 0.75),
padding: const EdgeInsets.all(12.0),
shrinkWrap: true,
primary: false,
physics: const ScrollPhysics(),
children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
).objectContainerView(),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
// if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
// // GridView(
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
// // shrinkWrap: true,
// // primary: false,
// // physics: const ScrollPhysics(),
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
// // )
// // ItemDetailViewCol(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
//
// // GridView(
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
// // shrinkWrap: true,
// // primary: false,
// // physics: const ScrollPhysics(),
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
// // )
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
// ],
// ).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
],

@ -425,7 +425,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList,));
break;
case "REJECT":
performNetworkCall(context, email: "", userId: "");
// performNetworkCall(context, email: "", userId: "");
performAction(notificationButton.bUTTONACTION!);
break;
case "RETURNED":
Navigator.pop(context);

@ -88,16 +88,18 @@ class AcceptRejectInputDialog extends StatelessWidget {
).expanded,
10.width,
DefaultButton(
actionMode == "REJECTED" ? LocaleKeys.reject.tr() : LocaleKeys.ok.tr(),
(actionMode == "REJECTED" || actionMode == "REJECT") ? LocaleKeys.reject.tr() : LocaleKeys.ok.tr(),
() {
if(note.isNotEmpty) {
Navigator.pop(context);
onTap(note);
} else {
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
if (note.isEmpty) {
if (actionMode == "APPROVED" || actionMode == "APPROVE") {
Navigator.pop(context);
onTap(note);
} else {
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
}
}
},
colors: actionMode == "REJECTED"
colors: (actionMode == "REJECTED" || actionMode == "REJECT")
? const [
Color(0xffE47A7E),
Color(0xffE47A7E),

Loading…
Cancel
Save