@ -312,6 +312,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
AppState ( ) . setWorkListIndex = AppState ( ) . workListIndex ! + 1 ;
AppState ( ) . setWorkListIndex = AppState ( ) . workListIndex ! + 1 ;
workListData = null ;
workListData = null ;
showFabOptions = false ;
showFabOptions = false ;
tabIndex = 0 ;
getDataFromState ( ) ;
getDataFromState ( ) ;
} else if ( AppState ( ) . workList ! . length - 1 = = AppState ( ) . workListIndex ! ) {
} else if ( AppState ( ) . workList ! . length - 1 = = AppState ( ) . workListIndex ! ) {
Navigator . pop ( context ) ;
Navigator . pop ( context ) ;
@ -354,26 +355,35 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if ( notificationButtonsList [ i ] . bUTTONACTION ! = = " REJECTED " | | notificationButtonsList [ i ] . bUTTONACTION ! = = " APPROVED " | | notificationButtonsList [ i ] . bUTTONACTION ! = = " CLOSE " ) {
if ( notificationButtonsList [ i ] . bUTTONACTION ! = = " REJECTED " | | notificationButtonsList [ i ] . bUTTONACTION ! = = " APPROVED " | | notificationButtonsList [ i ] . bUTTONACTION ! = = " CLOSE " ) {
continue ;
continue ;
}
}
fabs . add ( myFab ( notificationButtonsList [ i ] . bUTTONLABEL ! , notificationButtonsList [ i ] . bUTTONACTION = = " DELEGATE " ? " assets/images/delegate.svg " : notificationButtonsList [ i ] . bUTTONICON ? ? " " ,
fabs . add ( myFab (
isIconAsset: notificationButtonsList [ i ] . bUTTONACTION = = " DELEGATE " ? true : false , )
notificationButtonsList [ i ] . bUTTONLABEL ! ,
. paddingOnly ( bottom: 12 )
notificationButtonsList [ i ] . bUTTONACTION = = " DELEGATE " ? " assets/images/delegate.svg " : notificationButtonsList [ i ] . bUTTONICON ? ? " " ,
. onPress ( ( ) = > handleFabAction ( notificationButtonsList [ i ] ) ) ) ;
isIconAsset: notificationButtonsList [ i ] . bUTTONACTION = = " DELEGATE " ? true : false ,
) . paddingOnly ( bottom: 12 ) . onPress ( ( ) = > handleFabAction ( notificationButtonsList [ i ] ) ) ) ;
}
}
return fabs ;
return fabs ;
}
}
void handleFabAction ( GetNotificationButtonsList notificationButton ) {
void handleFabAction ( GetNotificationButtonsList notificationButton ) {
print ( " notificationButton: ${ notificationButton . bUTTONACTION } " ) ;
switch ( notificationButton . bUTTONACTION ) {
switch ( notificationButton . bUTTONACTION ) {
case " DELEGATE " :
case " DELEGATE " :
showMyBottomSheet ( context ,
showMyBottomSheet ( context ,
child: DelegateSheet ( title: LocaleKeys . delegate . tr ( ) , apiMode: notificationButton . bUTTONACTION ! , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
child: DelegateSheet ( title: LocaleKeys . delegate . tr ( ) , apiMode: notificationButton . bUTTONACTION ! , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
break ;
case " REQUEST_INFO " :
case " REQUEST_INFO " :
/ / do something else
/ / do something else
showMyBottomSheet ( context ,
showMyBottomSheet ( context ,
child: DelegateSheet ( title: LocaleKeys . request_info . tr ( ) , apiMode: " REQUEST_INFO " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
child: DelegateSheet ( title: LocaleKeys . request_info . tr ( ) , apiMode: " REQUEST_INFO " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
break ;
case " TRANSFER_INFO " :
/ / do something else
showMyBottomSheet ( context ,
child: DelegateSheet ( title: notificationButton . bUTTONLABEL ! , apiMode: notificationButton . bUTTONACTION ! , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
case " ANSWER_INFO " :
performAction ( notificationButton . bUTTONACTION ! , title: notificationButton . bUTTONLABEL ) ;
break ;
case " RFC " :
case " RFC " :
/ / do something else
/ / do something else
break ;
break ;
@ -384,10 +394,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
/ / do something else
/ / do something else
case " APPROVE_AND_FORWARD " :
case " APPROVE_AND_FORWARD " :
showMyBottomSheet ( context ,
showMyBottomSheet ( context ,
child: DelegateSheet ( title: " Approve and Forward " , apiMode: " APPROVE_AND_FORWARD " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
child: DelegateSheet ( title: " Approve and Forward " , apiMode: notificationButton . bUTTONACTION ! , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
break ;
case " FORWARD " :
case " FORWARD " :
showMyBottomSheet ( context , child: DelegateSheet ( title: " Forward " , apiMode: " FORWARD " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
showMyBottomSheet ( context , child: DelegateSheet ( title: " Forward " , apiMode: notificationButton . bUTTONACTION ! , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
break ;
case " REJECT " :
case " REJECT " :
performNetworkCall ( context , email: " " , userId: " " ) ;
performNetworkCall ( context , email: " " , userId: " " ) ;
@ -480,12 +490,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
) ;
) ;
}
}
void performAction ( String actionMode ) {
void performAction ( String actionMode ,{ String ? title } ) {
TextEditingController textEditingController = TextEditingController ( ) ;
TextEditingController textEditingController = TextEditingController ( ) ;
showDialog (
showDialog (
context: context ,
context: context ,
builder: ( cxt ) = > AcceptRejectInputDialog (
builder: ( cxt ) = > AcceptRejectInputDialog (
message: LocaleKeys . requestedItems . tr ( ) ,
message: title ! = null ? null : LocaleKeys . requestedItems . tr ( ) ,
title: title ,
notificationGetRespond: notificationNoteInput ,
notificationGetRespond: notificationNoteInput ,
onTap: ( note ) {
onTap: ( note ) {
Map < String , dynamic > payload = {
Map < String , dynamic > payload = {