approval level commented Code for filter .

etqan_ovr_integration
aamir-csol 17 hours ago
parent 74bcf3e1b7
commit dfa7d9a713

@ -258,6 +258,7 @@
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"submitAsAnonymous": "إرسال كمجهول",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",

@ -256,6 +256,7 @@
"remove": "Remove",
"Attendance": "Attendance",
"submit": "Submit",
"submitAsAnonymous": "Submit as Anonymous",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",

@ -93,7 +93,7 @@ class EtqanApiClient {
);
}
Future<int?> createRequest(String description, int? projectID, String? attachmentBase64) async {
Future<int?> createRequest(String description, int? projectID, String? attachmentBase64, bool? isAnonymous) async {
String url = "${ApiConsts.cocRest}ETQAN_CreateIncident";
Map<String, dynamic> postParams = <String, dynamic>{
"P_SELECTED_EMPLOYEE_NUMBER": AppState().memberInformationList?.eMPLOYEENUMBER,
@ -102,7 +102,7 @@ class EtqanApiClient {
"ETQAN_Description": description,
"ETQAN_ProjectId": projectID,
"ETQAN_FileInfoBase64": attachmentBase64,
"ETQAN_IsAnonymous": false,
"ETQAN_IsAnonymous": isAnonymous ?? false,
};
postParams.addAll(AppState().postParamsJson);

@ -274,6 +274,7 @@ class CodegenLoader extends AssetLoader{
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"submitAsAnonymous": "إرسال كمجهول",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",
@ -919,6 +920,7 @@ static const Map<String,dynamic> _en_US = {
"remove": "Remove",
"Attendance": "Attendance",
"submit": "Submit",
"submitAsAnonymous": "Submit as Anonymous",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",

@ -261,6 +261,7 @@ abstract class LocaleKeys {
static const fullName = 'fullName';
static const remove = 'remove';
static const submit = 'submit';
static const submitAsAnonymous = 'submitAsAnonymous';
static const areYouSureYouWantToSubmit = 'areYouSureYouWantToSubmit';
static const comments = 'comments';
static const writeComment = 'writeComment';

@ -43,6 +43,7 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
File? attachment;
String? attachmentBase64;
String description = '';
bool isAnonymous = false;
/// Initialize speech recognition - call this once when screen loads
Future<void> initSpeech() async {
@ -149,6 +150,12 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
notifyListeners();
}
// Set isAnonymous
void setIsAnonymous(bool value) {
isAnonymous = value;
notifyListeners();
}
// Clear create request form
void clearCreateRequestForm() {
selectedProject = null;
@ -156,6 +163,7 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
attachment = null;
attachmentBase64 = null;
description = '';
isAnonymous = false;
notifyListeners();
}
@ -163,7 +171,7 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Future<bool> submitRequest(BuildContext context) async {
try {
Utils.showLoading(context);
int? isSuccess = await EtqanApiClient().createRequest(description, selectedProject?.projectId, attachmentBase64);
int? isSuccess = await EtqanApiClient().createRequest(description, selectedProject?.projectId, attachmentBase64, isAnonymous);
Utils.hideLoading(context);
if (isSuccess == 1) {
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();

@ -74,6 +74,8 @@ class _EtqanOvrCreateRequestState extends State<EtqanOvrCreateRequest> {
_buildAttachmentSection(provider),
16.height,
_buildDescriptionField(provider),
16.height,
_buildAnonymousCheckbox(provider),
24.height,
],
)).expanded,
@ -276,4 +278,41 @@ class _EtqanOvrCreateRequestState extends State<EtqanOvrCreateRequest> {
),
);
}
Widget _buildAnonymousCheckbox(EtqanOvrProviderModel provider) {
return InkWell(
onTap: () {
provider.setIsAnonymous(!provider.isAnonymous);
},
borderRadius: BorderRadius.circular(15),
child: Row(
children: <Widget>[
Checkbox(
value: provider.isAnonymous,
onChanged: (bool? value) {
if (value != null) {
provider.setIsAnonymous(value);
}
},
activeColor: MyColors.gradiantEndColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
),
const SizedBox(width: 8),
Expanded(
child: Text(
LocaleKeys.submitAsAnonymous.tr(),
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
),
],
),
);
}
}

Loading…
Cancel
Save