|
|
|
|
@ -35,6 +35,7 @@ class ItgDetailScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
int tabIndex = 0;
|
|
|
|
|
int animationIndex = 0;
|
|
|
|
|
PageController controller = PageController();
|
|
|
|
|
bool showFabOptions = false;
|
|
|
|
|
|
|
|
|
|
@ -82,6 +83,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
|
|
|
|
|
void getDataFromState() {
|
|
|
|
|
if (requestDetails == null) {
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
|
requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
|
|
|
|
|
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
|
|
|
|
|
getItgData();
|
|
|
|
|
@ -95,7 +97,24 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
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(animationIndex),
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
@ -218,6 +237,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
children: [
|
|
|
|
|
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
|
|
|
|
|
if (AppState().requestAllList!.length - 1 > AppState().itgWorkListIndex!) {
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
|
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
|
|
|
|
|
requestDetails = null;
|
|
|
|
|
itgRequest = null;
|
|
|
|
|
@ -241,6 +261,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
|
|
|
|
|
? Container(
|
|
|
|
|
height: 43,
|
|
|
|
|
@ -514,6 +535,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
|
|
|
|
|
// Navigator.pop(context, "delegate_reload");
|
|
|
|
|
animationIndex=animationIndex+1;
|
|
|
|
|
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
|
|
|
|
|
if (AppState().requestAllList!.isEmpty) {
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
@ -534,9 +556,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
|
ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", "");
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
|
|
|
|
|
|
|
|
|
|
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
|
|
|
|
|
if (AppState().requestAllList!.isEmpty) {
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
@ -555,6 +579,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void reloadITG() {
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
|
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
|
|
|
|
|
if (AppState().requestAllList!.isEmpty) {
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
|