Merge branch 'development_mirza' into 'master'

worklist animation & loader

See merge request Cloud_Solution/mohemm-flutter-app!82
sultan-dev
haroon amjad 2 years ago
commit e6f22e5933

@ -2,8 +2,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
//static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -109,8 +109,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
}
}
}
await LeaveBalanceApiClient()
.validateAbsenceTransaction(
await LeaveBalanceApiClient().validateAbsenceTransaction(
selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
"HR_LOA_SS",
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
@ -134,8 +133,10 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
var res = await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
if (res != null && res == true) {
Utils.showLoading(context);
}
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {

@ -129,7 +129,7 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.pItemId,
params!.transactionId,
);
}else if (params!.approvalFlag == 'endEmployment') {
} else if (params!.approvalFlag == 'endEmployment') {
await TerminationDffApiClient().startTermApprovalProcess(
"SUBMIT",
comments.text,

@ -96,9 +96,11 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
SubmitEITTransactionList submitEITTransactionList =
await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp ?? '');
Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
var res = await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit'));
if (res != null && res == true) {
Utils.showLoading(context);
}
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {

@ -191,7 +191,24 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
return Scaffold(
appBar: AppBarWidget(context, title: LocaleKeys.details.tr()),
backgroundColor: Colors.white,
body: Stack(
body: AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
switchInCurve: Curves.easeInToLinear,
transitionBuilder: (Widget child, Animation<double> animation) {
Animation<Offset> custom = Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation);
return ClipRect(
child: SlideTransition(
position: custom,
child: child,
// textDirection: TextDirection.ltr,
),
);
},
child: Stack(
key: ValueKey(AppState().workListIndex ?? 0),
children: [
Column(
children: [
@ -224,7 +241,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
PageView(
controller: controller,
onPageChanged: (pageIndex) {
onPageChanged: (int pageIndex) {
setState(() {
tabIndex = pageIndex;
});
@ -355,6 +372,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
),
],
),
),
floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
? Container(
height: 43,
@ -546,7 +564,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(
builder: (BuildContext cxt) => ConfirmDialog(
message: LocaleKeys.wantToReject.tr(),
okTitle: LocaleKeys.reject.tr(),
onTap: () async {
@ -629,12 +647,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
print(actionMode);
showDialog(
context: context,
builder: (cxt) => AcceptRejectInputDialog(
builder: (BuildContext cxt) => AcceptRejectInputDialog(
message: title != null ? null : LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput,
actionMode: actionMode,
onTap: (note) {
onTap: (String note) {
Map<String, dynamic> payload = {
"P_ACTION_MODE": actionMode,
"P_APPROVER_INDEX": null,
@ -915,9 +933,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
apiCallCount++;
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");
isApproveAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "APPROVED");
isRejectAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "REJECTED");
isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE");
isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "APPROVED");
isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "REJECTED");
}
apiCallCount--;
if (apiCallCount == 0) {

@ -20,7 +20,7 @@ AppBar AppBarWidget(BuildContext context,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context, true), context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
4.width,
@ -59,7 +59,7 @@ AppBar AppBarWidget(BuildContext context,
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
...actions??[]
...actions ?? []
],
);
}

Loading…
Cancel
Save