@ -24,6 +24,7 @@ import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_mod
import ' package:mohem_flutter_app/models/member_information_list_model.dart ' ;
import ' package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart ' ;
import ' package:mohem_flutter_app/models/worklist_response_model.dart ' ;
import ' package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart ' ;
import ' package:mohem_flutter_app/ui/work_list/worklist_fragments/actions_fragment.dart ' ;
import ' package:mohem_flutter_app/ui/work_list/worklist_fragments/attachments_fragment.dart ' ;
import ' package:mohem_flutter_app/ui/work_list/worklist_fragments/detail_fragment.dart ' ;
@ -37,6 +38,8 @@ import '../../models/worklist/hr/eit_otification_body_model.dart';
import ' ../../models/worklist/hr/get_basic_det_ntf_body_list_model.dart ' ;
import ' ../../models/worklist/hr/get_contact_notification_body_list_model.dart ' ;
import ' ../../models/worklist/hr/get_phones_notification_body_list_model.dart ' ;
import ' ../../widgets/bottom_sheet.dart ' ;
import ' ../../widgets/dialogs/confirm_dialog.dart ' ;
class WorkListDetailScreen extends StatefulWidget {
WorkListDetailScreen ( { Key ? key } ) : super ( key: key ) ;
@ -107,7 +110,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getAbsenceCollectionNotificationBodyList = await WorkListApiClient ( ) . getAbsenceNotificationBody ( workListData ! . nOTIFICATIONID ) ;
} else if ( workListData ! . rEQUESTTYPE = = " CONTACT " ) {
getContactNotificationBodyList = await WorkListApiClient ( ) . getContactNotificationBodyList ( workListData ! . nOTIFICATIONID ) ;
}
/ / getBasicNTFBody = await WorkListApiClient ( ) . getBasicDetNTFBody ( workListData ! . nOTIFICATIONID ! , - 999 ) ;
@ -359,19 +361,59 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
switch ( notificationButton . bUTTONACTION ) {
case " DELEGATE " :
/ / do something
showMyBottomSheet ( context , child: DelegateSheet ( title: " Delegate " , apiMode: " DELEGATE " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
case " REQUEST_INFO " :
/ / do something else
showMyBottomSheet ( context , child: DelegateSheet ( title: " Request Info " , apiMode: " REQUEST_INFO " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
case " RFC " :
/ / do something else
break ;
case " UPDATE_ACTION " :
/ / do something else
case " APPROVE_AND_FORWARD " :
/ / do something else
showMyBottomSheet ( context ,
child: DelegateSheet ( title: " Approve and Forward " , apiMode: " APPROVE_AND_FORWARD " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
case " FORWARD " :
/ / do something else
showMyBottomSheet ( context , child: DelegateSheet ( title: " Forward " , apiMode: " FORWARD " , notificationID: workListData ! . nOTIFICATIONID , actionHistoryList: actionHistoryList ) ) ;
break ;
case " REJECT " :
/ / do something else
performNetworkCall ( context , email: " " , userId: " " ) ;
break ;
case " RETURNED " :
/ / do something else
Navigator . pop ( context ) ;
break ;
}
}
Future < void > performNetworkCall ( BuildContext context , { String ? email , String ? userId } ) async {
showDialog (
context: context ,
builder: ( cxt ) = > ConfirmDialog (
message: " Are you sure want to reject? " ,
okTitle: " Reject " ,
onTap: ( ) async {
Navigator . pop ( cxt ) ;
Utils . showLoading ( context ) ;
try {
await WorkListApiClient ( ) . submitComment ( comment: " " , email: email , userId: userId , notificationId: workListData ! . nOTIFICATIONID , apiMode: " REJECT " ) ;
Utils . hideLoading ( context ) ;
Navigator . pop ( context , " delegate_reload " ) ;
} catch ( ex ) {
Utils . hideLoading ( context ) ;
Utils . handleException ( ex , context , null ) ;
}
} ,
) ,
) ;
}
Widget myTab ( String title , int index ) {
bool isSelected = ( index = = tabIndex ) ;
return Column (