Merge branch 'development_sikander' into 'master'

Development sikander

See merge request mirza.shafique/mohem_flutter_app!40
merge-requests/1/merge
Sikander Saleem 3 years ago
commit 56f111ca70

@ -14,6 +14,10 @@ analyzer:
always_use_package_imports: error always_use_package_imports: error
camel_case_types: error camel_case_types: error
always_declare_return_types: error always_declare_return_types: error
null_check_on_nullable_type_parameter: error
avoid_annotating_with_dynamic: error
unnecessary_null_checks: error
unnecessary_brace_in_string_interps: error
linter: linter:
@ -36,11 +40,15 @@ linter:
unnecessary_this: true unnecessary_this: true
unnecessary_new: true unnecessary_new: true
camel_case_types: true camel_case_types: true
null_check_on_nullable_type_parameter: true
sort_child_properties_last: true sort_child_properties_last: true
camel_case_extensions : true camel_case_extensions: true
require_trailing_commas: true require_trailing_commas: true
avoid_empty_else: true avoid_empty_else: true
avoid_annotating_with_dynamic: true avoid_annotating_with_dynamic: true
unnecessary_null_checks: true
unnecessary_brace_in_string_interps: true
unnecessary_string_interpolations: true
# avoid_print: false # Uncomment to disable the `avoid_print` rule # avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

@ -8,6 +8,7 @@ import 'package:http/io_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/main.dart';
// ignore_for_file: avoid_annotating_with_dynamic
typedef FactoryConstructor<U> = U Function(dynamic); typedef FactoryConstructor<U> = U Function(dynamic);

@ -8,8 +8,6 @@ import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
// import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -18,7 +16,7 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/loading_dialog.dart'; import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sizer/sizer.dart'; // ignore_for_file: avoid_annotating_with_dynamic
class Utils { class Utils {
static bool _isLoadingVisible = false; static bool _isLoadingVisible = false;

@ -327,7 +327,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${val}", "$val",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -358,7 +358,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${val}", "$val",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -384,7 +384,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${val}", "$val",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -408,7 +408,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${val}", "$val",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,

@ -125,7 +125,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Utils.showLoading(context); Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) { for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
String segmentId = structureList.cHILDSEGMENTSDVSplited![i]; String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
print("segmentId:${segmentId}"); print("segmentId:$segmentId");
print("segmentName:${structureList.sEGMENTNAME}"); print("segmentName:${structureList.sEGMENTNAME}");
GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId); GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
List<PARENTSEGMENTSDVSplited> parentRequired = parent.pARENTSEGMENTSDVSplited ?? []; List<PARENTSEGMENTSDVSplited> parentRequired = parent.pARENTSEGMENTSDVSplited ?? [];
@ -139,7 +139,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson()) .toJson())
.toList(); .toList();
print("values:${values}"); print("values:$values");
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);

@ -111,22 +111,22 @@ class _BasicDetailsState extends State<BasicDetails> {
), ),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
LocaleKeys.fullName.tr().toText13(color: MyColors.lightGrayColor), LocaleKeys.fullName.tr().toText13(color: MyColors.lightGrayColor),
"${fullName}".toText16(isBold: true, color: MyColors.blackColor), "$fullName".toText16(isBold: true, color: MyColors.blackColor),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
LocaleKeys.maritalStatus.tr().toText13(color: MyColors.lightGrayColor), LocaleKeys.maritalStatus.tr().toText13(color: MyColors.lightGrayColor),
"${maritalStatus}".toText16(isBold: true, color: MyColors.blackColor), "$maritalStatus".toText16(isBold: true, color: MyColors.blackColor),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
LocaleKeys.dateOfBirth.tr().toText13(color: MyColors.lightGrayColor), LocaleKeys.dateOfBirth.tr().toText13(color: MyColors.lightGrayColor),
"${birthDate}".toText16(isBold: true, color: MyColors.blackColor), "$birthDate".toText16(isBold: true, color: MyColors.blackColor),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
LocaleKeys.civilIdentityNumber.tr().toText13(color: MyColors.lightGrayColor), LocaleKeys.civilIdentityNumber.tr().toText13(color: MyColors.lightGrayColor),
"${civilIdentityNumber}".toText16(isBold: true, color: MyColors.blackColor), "$civilIdentityNumber".toText16(isBold: true, color: MyColors.blackColor),
]), ]),
), ),
], ],

@ -1,6 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,7 +30,6 @@ class DynamicProfileParams {
String colsURL; String colsURL;
List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList; List<GetEmployeeBasicDetailsList>? getEmployeeBasicDetailsList;
DynamicProfileParams(this.title, this.dynamicId, DynamicProfileParams(this.title, this.dynamicId,
{this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.getEmployeeBasicDetailsList = const <GetEmployeeBasicDetailsList>[]}); {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.getEmployeeBasicDetailsList = const <GetEmployeeBasicDetailsList>[]});
} }
@ -183,7 +181,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
setState(() {}); setState(() {});
}); });
} }
@ -194,7 +192,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
isReadOnly: model.rEADONLY == "Y", isReadOnly: model.rEADONLY == "Y",
onChange: (text) { onChange: (text) {
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = text; getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = text;
}, },
).paddingOnly(bottom: 12); ).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") { } else if (model.fORMATTYPE == "X") {
@ -249,7 +246,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
ESERVICESDV eservicesdv = ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![index].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME); ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![index].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME);
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION!; getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION;
setState(() {}); setState(() {});
}); });
} }

@ -124,9 +124,9 @@ class _ProfileState extends State<Profile> {
), ),
child: Column( child: Column(
children: [ children: [
"${fullName}".toText20(isBold: true, color: MyColors.blackColor), "$fullName".toText20(isBold: true, color: MyColors.blackColor),
"${employeeNo}".toText12(isBold: false, color: MyColors.lightGrayColor), "$employeeNo".toText12(isBold: false, color: MyColors.lightGrayColor),
"${emailAddress}".toText12(isBold: false, color: MyColors.black), "$emailAddress".toText12(isBold: false, color: MyColors.black),
SizedBox( SizedBox(
height: 5, height: 5,
), ),

@ -95,7 +95,6 @@ class _MowadhafhiHRRequestState extends State<MowadhafhiHRRequest> {
groupValue: selectedServiceType, groupValue: selectedServiceType,
selectedColor: MyColors.gradiantStartColor), selectedColor: MyColors.gradiantStartColor),
).onPress(() { ).onPress(() {
debugPrint(getTicketTypesList[index].typeName!);
selectedServiceType = getTicketTypesList[index].ticketTypeId!.toString(); selectedServiceType = getTicketTypesList[index].ticketTypeId!.toString();
setState(() {}); setState(() {});
}); });
@ -314,7 +313,7 @@ class _MowadhafhiHRRequestState extends State<MowadhafhiHRRequest> {
getMowadhafhiProjectsList = await MowadhafhiApiClient().getProjects(); getMowadhafhiProjectsList = await MowadhafhiApiClient().getProjects();
Utils.hideLoading(context); Utils.hideLoading(context);
getProjectDepartments(getMowadhafhiProjectsList[0].projectId!); getProjectDepartments(getMowadhafhiProjectsList[0].projectId!);
projectID = getMowadhafhiProjectsList[0].projectId!; projectID = getMowadhafhiProjectsList[0].projectId;
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -76,7 +76,7 @@ class _PendingTransactionsState extends State<PendingTransactions> {
for (int i = 0; i < getPendingTransactionsFunctions!.length; i++) PopupMenuItem<int>(child: Text(getPendingTransactionsFunctions![i].fUNCTIONPROMPT!), value: i), for (int i = 0; i < getPendingTransactionsFunctions!.length; i++) PopupMenuItem<int>(child: Text(getPendingTransactionsFunctions![i].fUNCTIONPROMPT!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
selectedFunction = getPendingTransactionsFunctions![popupIndex]; selectedFunction = getPendingTransactionsFunctions[popupIndex];
setState(() {}); setState(() {});
}), }),
12.height, 12.height,

@ -485,7 +485,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
"P_APPROVER_INDEX": null, "P_APPROVER_INDEX": null,
"P_COMMENTS": "", "P_COMMENTS": "",
"P_FORWARD_TO_USER_NAME": "", "P_FORWARD_TO_USER_NAME": "",
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID!, "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
"RespondAttributeList": [ "RespondAttributeList": [
if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note} if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note}
], ],

Loading…
Cancel
Save