Merge branch 'development_sikander' into 'master'

Development sikander

See merge request mirza.shafique/mohem_flutter_app!30
merge-requests/1/merge
Sikander Saleem 4 years ago
commit dd146179ec

@ -10,7 +10,8 @@
<application
android:icon="@mipmap/ic_launcher"
android:label="Mohemm"
android:networkSecurityConfig="@xml/network_security_config">
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
</resources>

@ -245,6 +245,12 @@
"maritalStatus ": "الحالة الاجتماعية",
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",
"approversList": "قائمة الموافقين",
"yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -246,6 +246,12 @@
"fullName": "Full Name",
"remove": "Remove",
"Attendance":"Attendance",
"submit": "Submit",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",
"approversList": "Approvers List",
"yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals",
"profile": {
"reset_password": {
"label": "Reset Password",

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

@ -1,122 +1,128 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
"images":[
{
"idiom":"iphone",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"iphone",
"size":"20x20",
"scale":"3x",
"filename":"Icon-App-20x20@3x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"3x",
"filename":"Icon-App-29x29@3x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"3x",
"filename":"Icon-App-40x40@3x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"2x",
"filename":"Icon-App-60x60@2x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"3x",
"filename":"Icon-App-60x60@3x.png"
},
{
"idiom":"iphone",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"1x",
"filename":"Icon-App-20x20@1x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"1x",
"filename":"Icon-App-40x40@1x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"1x",
"filename":"Icon-App-76x76@1x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"83.5x83.5",
"scale":"2x",
"filename":"Icon-App-83.5x83.5@2x.png"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"scale" : "1x",
"filename" : "ItunesArtwork@2x.png"
}
],
"info":{
"version":1,
"author":"easyappicon"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

@ -90,6 +90,8 @@ class LoginApiClient {
AppState().postParamsObject?.pSessionId = responseData.pSESSIONID;
AppState().postParamsObject?.pUserName = AppState().getUserName;
AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName;
AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLEGISLATIONCODE;
AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE;
return responseData;
}, url, postParams);

@ -3,8 +3,11 @@ import 'dart:async';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'api_client.dart';
@ -54,4 +57,100 @@ class MyAttendanceApiClient {
return responseData.getValueSetValuesList!.first;
}, url, postParams);
}
Future<ESERVICESDV> getDefaultValue(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}GET_DEFAULT_VALUE";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_PARENT_VALUE": null,
"P_SEGMENT_NAME": pSegmentName,
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_DESC_FLEX_NAME": pDescFlexName,
"GetValueSetValuesTBL": list,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<GenericResponseModel?> validateEitTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}VALIDATE_EIT_TRANSACTION";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_FUNCTION_NAME": pFunctionName,
"EITTransactionTBL": list,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<SubmitEITTransactionList> submitEitTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}SUBMIT_EIT_TRANSACTION";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_FUNCTION_NAME": pFunctionName,
//"EITTransactionTBL": list,
// "EITTransactionTBLModel": list,
};
postParams.addAll(AppState().postParamsJson);
print("postParams:$postParams");
postParams["EITTransactionTBL"] = list;
postParams["EITTransactionTBLModel"] = list;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.submitEITTransactionList!; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson());
}, url, postParams);
}
Future<List<GetApprovesList>> getApproversList(String pAmeTransactionType, int pTransactionId) async {
String url = "${ApiConsts.erpRest}GET_APPROVERS_LIST";
Map<String, dynamic> postParams = {
"P_AME_TRANSACTION_TYPE": pAmeTransactionType,
"P_PAGE_LIMIT": 1000,
"P_PAGE_NUM": 1,
"P_TRANSACTION_ID": pTransactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getApprovesList ?? [];
}, url, postParams);
}
Future<List<GetApprovesList>> addAttachment(List<Map<String, dynamic>> list) async {
String url = "${ApiConsts.erpRest}ADD_ATTACHMENT";
Map<String, dynamic> postParams = {"AddAttachmentList": list};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getApprovesList ?? [];
}, url, postParams);
}
Future<StartEitApprovalProcess?> startEitApprovalProcess(String action, String comments, String itemKey, int transactionId) async {
String url = "${ApiConsts.erpRest}START_EIT_APPROVAL_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_ACTION_MODE": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startEitApprovalProcess;
}, url, postParams);
}
}

@ -17,9 +17,15 @@ class Utils {
static bool get isLoading => _isLoadingVisible;
static void showToast(String message) {
static void showToast(String message, {bool longDuration = false}) {
Fluttertoast.showToast(
msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 1, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0);
msg: message,
toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.black54,
textColor: Colors.white,
fontSize: 16.0);
}
static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -39,7 +45,7 @@ class Utils {
}
static void showLoading(BuildContext context) {
WidgetsBinding.instance?.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_isLoadingVisible = true;
showDialog(
context: context,

@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/login/forgot_password_screen.dart';
@ -6,27 +8,25 @@ import 'package:mohem_flutter_app/ui/login/login_screen.dart';
import 'package:mohem_flutter_app/ui/login/new_password_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_last_login_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/profile/basic_details.dart';
import 'package:mohem_flutter_app/ui/profile/contact_details.dart';
import 'package:mohem_flutter_app/ui/profile/delete_familyMember.dart';
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/profile/personal_info.dart';
// import 'package:mohem_flutter_app/ui/my_attendance/work_from_home_screen.dart';
import 'package:mohem_flutter_app/ui/screens/eit/add_eit.dart';
import 'package:mohem_flutter_app/ui/screens/profile/profile_screen.dart';
import 'package:mohem_flutter_app/ui/screens/submenu_screen.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart';
import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart';
import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart';
import 'package:mohem_flutter_app/ui/profile/profile.dart';
import 'package:mohem_flutter_app/ui/profile/personal_info.dart';
import 'package:mohem_flutter_app/ui/profile/basic_details.dart';
import 'package:mohem_flutter_app/ui/profile/contact_details.dart';
import 'package:mohem_flutter_app/ui/profile/family_members.dart';
import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart';
class AppRoutes {
static const String splash = "/splash";
@ -53,10 +53,12 @@ class AppRoutes {
static const String myAttendance = "/myAttendance";
static const String dynamicScreen = "/dynamicScreen";
static const String addDynamicInput = "/addDynamicInput";
static const String requestSubmitScreen = "/requestSubmitScreen";
//profile
static const String addDynamicInputProfile = 'addDynamicInputProfile';
//Attendance
static const String attendance = "/attendance";
static const String monthlyAttendance = "/monthlyAttendance";
@ -113,5 +115,6 @@ class AppRoutes {
addDynamicInput: (context) => DynamicInputScreen(),
addDynamicInputProfile: (context) => DynamicInputScreenProfile(),
deleteFamilyMember: (context) => DeleteFamilyMember(),
requestSubmitScreen: (context) => RequestSubmitScreen(),
};
}

@ -1,8 +1,6 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
extension CapExtension on String {
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";
@ -64,10 +62,12 @@ extension EmailValidator on String {
this,
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText20({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
this,
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
Widget toText22({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
@ -84,9 +84,9 @@ extension EmailValidator on String {
);
Widget toText44({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
this,
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
String upper = "";

@ -261,6 +261,12 @@ class CodegenLoader extends AssetLoader{
"maritalStatus ": "الحالة الاجتماعية",
"fullName": "الأسم الكامل",
"remove": "حذف",
"submit": "ارسال",
"areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟",
"comments": "تعليقات",
"writeComment": "أكتب تعليقا",
"approversList": "قائمة الموافقين",
"yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -548,6 +554,12 @@ static const Map<String,dynamic> en_US = {
"fullName": "Full Name",
"remove": "Remove",
"Attendance": "Attendance",
"submit": "Submit",
"areYouSureYouWantToSubmit": "Are you sure you want to submit?",
"comments": "Comments",
"writeComment": "Write a comment",
"approversList": "Approvers List",
"yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -246,6 +246,12 @@ abstract class LocaleKeys {
static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName';
static const remove = 'remove';
static const submit = 'submit';
static const areYouSureYouWantToSubmit = 'areYouSureYouWantToSubmit';
static const comments = 'comments';
static const writeComment = 'writeComment';
static const approversList = 'approversList';
static const yourRequestHasBeenSubmittedForApprovals = 'yourRequestHasBeenSubmittedForApprovals';
static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password';

@ -1,10 +1,10 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:logger/logger.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/app_provider.dart';
import 'package:mohem_flutter_app/generated/codegen_loader.g.dart';
import 'package:mohem_flutter_app/models/post_params_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
@ -16,9 +16,8 @@ import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart';
import 'package:provider/provider.dart';
import 'package:sizer/sizer.dart';
import 'package:firebase_core/firebase_core.dart';
import 'config/routes.dart';
import 'package:logger/logger.dart';
var logger = Logger(
// filter: null, // Use the default LogFilter (-> only log in debug mode)
@ -31,7 +30,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp();
AppState().setPostParamsModel(
PostParamsModel(channel: 31, versionID: 4.0, mobileType: Platform.isAndroid ? "android" : "ios"),
PostParamsModel(channel: 31, versionID: 5.0, mobileType: Platform.isAndroid ? "android" : "ios"),
);
runApp(
EasyLocalization(

@ -0,0 +1,18 @@
class AddAttSuccessList {
bool? addSuccess;
int? attachmentID;
AddAttSuccessList({this.addSuccess, this.attachmentID});
AddAttSuccessList.fromJson(Map<String, dynamic> json) {
addSuccess = json['AddSuccess'];
attachmentID = json['AttachmentID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AddSuccess'] = this.addSuccess;
data['AttachmentID'] = this.attachmentID;
return data;
}
}

@ -0,0 +1,18 @@
class AddAttachmentList {
String? pRETURNMSG;
String? pRETURNSTATUS;
AddAttachmentList({this.pRETURNMSG, this.pRETURNSTATUS});
AddAttachmentList.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,27 @@
class AttachmentModel {
int? attachmentID;
String? pFILECONTENTTYPE;
String? pFILEDATA;
String? pFILENAME;
int? pTRANSACTIONID;
AttachmentModel({this.attachmentID, this.pFILECONTENTTYPE, this.pFILEDATA, this.pFILENAME, this.pTRANSACTIONID});
AttachmentModel.fromJson(Map<String, dynamic> json) {
attachmentID = json['AttachmentID'];
pFILECONTENTTYPE = json['P_FILE_CONTENT_TYPE'];
pFILEDATA = json['P_FILE_DATA'];
pFILENAME = json['P_FILE_NAME'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AttachmentID'] = this.attachmentID;
data['P_FILE_CONTENT_TYPE'] = this.pFILECONTENTTYPE;
data['P_FILE_DATA'] = this.pFILEDATA;
data['P_FILE_NAME'] = this.pFILENAME;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -0,0 +1,27 @@
class ValidateEitTransactionModel {
int? tRANSACTIONNUMBER;
String? nAME;
String? vARCHAR2VALUE;
int? nUMBERVALUE;
String? dATEVALUE;
ValidateEitTransactionModel({this.tRANSACTIONNUMBER, this.nAME, this.vARCHAR2VALUE, this.nUMBERVALUE, this.dATEVALUE});
ValidateEitTransactionModel.fromJson(Map<String, dynamic> json) {
tRANSACTIONNUMBER = json['TRANSACTION_NUMBER'];
nAME = json['NAME'];
vARCHAR2VALUE = json['VARCHAR2_VALUE'];
nUMBERVALUE = json['NUMBER_VALUE'];
dATEVALUE = json['DATE_VALUE'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['TRANSACTION_NUMBER'] = this.tRANSACTIONNUMBER;
data['NAME'] = this.nAME;
data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE;
data['NUMBER_VALUE'] = this.nUMBERVALUE;
data['DATE_VALUE'] = this.dATEVALUE;
return data;
}
}

@ -1,6 +1,10 @@
import 'package:mohem_flutter_app/models/add_att_success_list_model.dart';
import 'package:mohem_flutter_app/models/add_attachment_list_model.dart';
import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/models/get_attachement_list_model.dart';
import 'package:mohem_flutter_app/models/get_default_value_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart';
@ -26,12 +30,15 @@ import 'package:mohem_flutter_app/models/notification_get_respond_attributes_lis
import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'basic_member_information_model.dart';
@ -72,8 +79,8 @@ class GenericResponseModel {
String? successMsg;
String? successMsgN;
String? vidaUpdatedResponse;
String? addAttSuccessList;
String? addAttachmentList;
List<AddAttSuccessList>? addAttSuccessList;
AddAttachmentList? addAttachmentList;
String? bCDomain;
String? bCLogo;
BasicMemberInformationModel? basicMemberInformation;
@ -102,7 +109,7 @@ class GenericResponseModel {
List<GetActionHistoryList>? getActionHistoryList;
List<String>? getAddressDffStructureList;
List<String>? getAddressNotificationBodyList;
List<String>? getApprovesList;
List<GetApprovesList>? getApprovesList;
List<GetAttachementList>? getAttachementList;
GetAttendanceTracking? getAttendanceTrackingList;
List<GetBasicDetColsStructureList>? getBasicDetColsStructureList;
@ -123,7 +130,7 @@ class GenericResponseModel {
List<String>? getCountriesList;
List<GetDayHoursTypeDetailsList>? getDayHoursTypeDetailsList;
List<String>? getDeductionsList;
List<String>? getDefaultValueList;
GetDefaultValueList? getDefaultValueList;
List<GetEitCollectionNotificationBodyList>? getEITCollectionNotificationBodyList;
List<GetEITDFFStructureList>? getEITDFFStructureList;
List<GetEITTransactionList>? getEITTransactionList;
@ -257,7 +264,7 @@ class GenericResponseModel {
String? startBasicDetApprProcessList;
String? startCeiApprovalProcess;
String? startContactApprovalProcessList;
String? startEitApprovalProcess;
StartEitApprovalProcess? startEitApprovalProcess;
String? startHrApprovalProcessList;
String? startPhonesApprovalProcessList;
String? startSitApprovalProcess;
@ -267,7 +274,7 @@ class GenericResponseModel {
String? submitCEITransactionList;
String? submitCcpTransactionList;
String? submitContactTransactionList;
String? submitEITTransactionList;
SubmitEITTransactionList? submitEITTransactionList;
String? submitHrTransactionList;
String? submitPhonesTransactionList;
String? submitSITTransactionList;
@ -286,7 +293,7 @@ class GenericResponseModel {
String? vHRGetProjectByCodeList;
bool? vHRIsVerificationCodeValid;
String? validateAbsenceTransactionList;
String? validateEITTransactionList;
ValidateEITTransactionList? validateEITTransactionList;
String? validatePhonesTransactionList;
String? vrItemTypesList;
String? wFLookUpList;
@ -578,8 +585,13 @@ class GenericResponseModel {
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
vidaUpdatedResponse = json['VidaUpdatedResponse'];
addAttSuccessList = json['AddAttSuccessList'];
addAttachmentList = json['AddAttachment_List'];
if (json['AddAttSuccessList'] != null) {
addAttSuccessList = <AddAttSuccessList>[];
json['AddAttSuccessList'].forEach((v) {
addAttSuccessList!.add(new AddAttSuccessList.fromJson(v));
});
}
addAttachmentList = json['AddAttachment_List'] != null ? new AddAttachmentList.fromJson(json['AddAttachment_List']) : null;
bCDomain = json['BC_Domain'];
bCLogo = json['BC_Logo'];
basicMemberInformation = json['BasicMemberInformation'] != null ? new BasicMemberInformationModel.fromJson(json['BasicMemberInformation']) : null;
@ -622,7 +634,13 @@ class GenericResponseModel {
getAddressDffStructureList = json['GetAddressDffStructureList'];
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
getApprovesList = json['GetApprovesList'];
if (json['GetApprovesList'] != null) {
getApprovesList = <GetApprovesList>[];
json['GetApprovesList'].forEach((v) {
getApprovesList!.add(new GetApprovesList.fromJson(v));
});
}
if (json['GetAttachementList'] != null) {
getAttachementList = <GetAttachementList>[];
@ -671,7 +689,7 @@ class GenericResponseModel {
});
}
getDeductionsList = json['GetDeductionsList'];
getDefaultValueList = json['GetDefaultValueList'];
getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null;
getEITCollectionNotificationBodyList = json["GetEITCollectionNotificationBodyList"] == null
? null
: List<GetEitCollectionNotificationBodyList>.from(json["GetEITCollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x)));
@ -946,7 +964,8 @@ class GenericResponseModel {
startBasicDetApprProcessList = json['StartBasicDetApprProcessList'];
startCeiApprovalProcess = json['StartCeiApprovalProcess'];
startContactApprovalProcessList = json['StartContactApprovalProcessList'];
startEitApprovalProcess = json['StartEitApprovalProcess'];
startEitApprovalProcess = json['StartEitApprovalProcess'] != null ? new StartEitApprovalProcess.fromJson(json['StartEitApprovalProcess']) : null;
startHrApprovalProcessList = json['StartHrApprovalProcessList'];
startPhonesApprovalProcessList = json['StartPhonesApprovalProcessList'];
startSitApprovalProcess = json['StartSitApprovalProcess'];
@ -956,7 +975,8 @@ class GenericResponseModel {
submitCEITransactionList = json['SubmitCEITransactionList'];
submitCcpTransactionList = json['SubmitCcpTransactionList'];
submitContactTransactionList = json['SubmitContactTransactionList'];
submitEITTransactionList = json['SubmitEITTransactionList'];
submitEITTransactionList = json['SubmitEITTransactionList'] != null ? new SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null;
submitHrTransactionList = json['SubmitHrTransactionList'];
submitPhonesTransactionList = json['SubmitPhonesTransactionList'];
submitSITTransactionList = json['SubmitSITTransactionList'];
@ -982,7 +1002,9 @@ class GenericResponseModel {
vHRGetProjectByCodeList = json['VHR_GetProjectByCodeList'];
vHRIsVerificationCodeValid = json['VHR_IsVerificationCodeValid'];
validateAbsenceTransactionList = json['ValidateAbsenceTransactionList'];
validateEITTransactionList = json['ValidateEITTransactionList'];
validateEITTransactionList = json['ValidateEITTransactionList'] != null ? new ValidateEITTransactionList.fromJson(json['ValidateEITTransactionList']) : null;
validatePhonesTransactionList = json['ValidatePhonesTransactionList'];
vrItemTypesList = json['VrItemTypesList'];
wFLookUpList = json['WFLookUpList'];
@ -1023,8 +1045,14 @@ class GenericResponseModel {
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['VidaUpdatedResponse'] = this.vidaUpdatedResponse;
data['AddAttSuccessList'] = this.addAttSuccessList;
data['AddAttachment_List'] = this.addAttachmentList;
if (this.addAttSuccessList != null) {
data['AddAttSuccessList'] = this.addAttSuccessList!.map((v) => v.toJson()).toList();
}
if (this.addAttachmentList != null) {
data['AddAttachment_List'] = this.addAttachmentList!.toJson();
}
data['BC_Domain'] = this.bCDomain;
data['BC_Logo'] = this.bCLogo;
if (this.basicMemberInformation != null) {
@ -1063,7 +1091,10 @@ class GenericResponseModel {
data['GetAddressDffStructureList'] = this.getAddressDffStructureList;
data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList;
data['GetApprovesList'] = this.getApprovesList;
if (this.getApprovesList != null) {
data['GetApprovesList'] = this.getApprovesList!.map((v) => v.toJson()).toList();
}
if (this.getAttachementList != null) {
data['GetAttachementList'] = this.getAttachementList!.map((v) => v.toJson()).toList();
@ -1094,7 +1125,9 @@ class GenericResponseModel {
data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList();
}
data['GetDeductionsList'] = this.getDeductionsList;
data['GetDefaultValueList'] = this.getDefaultValueList;
if (this.getDefaultValueList != null) {
data['GetDefaultValueList'] = this.getDefaultValueList!.toJson();
}
data['GetEITCollectionNotificationBodyList'] = this.getEITCollectionNotificationBodyList;
if (this.getEITDFFStructureList != null) {
data['GetEITDFFStructureList'] = this.getEITDFFStructureList!.map((v) => v.toJson()).toList();
@ -1297,7 +1330,10 @@ class GenericResponseModel {
data['StartBasicDetApprProcessList'] = this.startBasicDetApprProcessList;
data['StartCeiApprovalProcess'] = this.startCeiApprovalProcess;
data['StartContactApprovalProcessList'] = this.startContactApprovalProcessList;
data['StartEitApprovalProcess'] = this.startEitApprovalProcess;
if (this.startEitApprovalProcess != null) {
data['StartEitApprovalProcess'] = this.startEitApprovalProcess!.toJson();
}
data['StartHrApprovalProcessList'] = this.startHrApprovalProcessList;
data['StartPhonesApprovalProcessList'] = this.startPhonesApprovalProcessList;
data['StartSitApprovalProcess'] = this.startSitApprovalProcess;
@ -1307,7 +1343,11 @@ class GenericResponseModel {
data['SubmitCEITransactionList'] = this.submitCEITransactionList;
data['SubmitCcpTransactionList'] = this.submitCcpTransactionList;
data['SubmitContactTransactionList'] = this.submitContactTransactionList;
data['SubmitEITTransactionList'] = this.submitEITTransactionList;
if (this.submitEITTransactionList != null) {
data['SubmitEITTransactionList'] = this.submitEITTransactionList!.toJson();
}
data['SubmitHrTransactionList'] = this.submitHrTransactionList;
data['SubmitPhonesTransactionList'] = this.submitPhonesTransactionList;
data['SubmitSITTransactionList'] = this.submitSITTransactionList;
@ -1331,7 +1371,11 @@ class GenericResponseModel {
data['VHR_GetProjectByCodeList'] = this.vHRGetProjectByCodeList;
data['VHR_IsVerificationCodeValid'] = this.vHRIsVerificationCodeValid;
data['ValidateAbsenceTransactionList'] = this.validateAbsenceTransactionList;
data['ValidateEITTransactionList'] = this.validateEITTransactionList;
if (this.validateEITTransactionList != null) {
data['ValidateEITTransactionList'] = this.validateEITTransactionList!.toJson();
}
data['ValidatePhonesTransactionList'] = this.validatePhonesTransactionList;
data['VrItemTypesList'] = this.vrItemTypesList;
data['WFLookUpList'] = this.wFLookUpList;

@ -0,0 +1,60 @@
class GetApprovesList {
String? aPPROVALSTATUS;
String? aPPROVER;
String? aPPROVERCATEGORY;
int? aPPROVERORDERNUMBER;
String? aPPROVERTYPE;
String? eMPLOYEEIMAGE;
int? fROMROWNUM;
int? lINENO;
int? nOOFROWS;
String? pOSITIONTITLE;
int? rOWNUM;
int? tOROWNUM;
GetApprovesList(
{this.aPPROVALSTATUS,
this.aPPROVER,
this.aPPROVERCATEGORY,
this.aPPROVERORDERNUMBER,
this.aPPROVERTYPE,
this.eMPLOYEEIMAGE,
this.fROMROWNUM,
this.lINENO,
this.nOOFROWS,
this.pOSITIONTITLE,
this.rOWNUM,
this.tOROWNUM});
GetApprovesList.fromJson(Map<String, dynamic> json) {
aPPROVALSTATUS = json['APPROVAL_STATUS'];
aPPROVER = json['APPROVER'];
aPPROVERCATEGORY = json['APPROVER_CATEGORY'];
aPPROVERORDERNUMBER = json['APPROVER_ORDER_NUMBER'];
aPPROVERTYPE = json['APPROVER_TYPE'];
eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE'];
fROMROWNUM = json['FROM_ROW_NUM'];
lINENO = json['LINE_NO'];
nOOFROWS = json['NO_OF_ROWS'];
pOSITIONTITLE = json['POSITION_TITLE'];
rOWNUM = json['ROW_NUM'];
tOROWNUM = json['TO_ROW_NUM'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['APPROVAL_STATUS'] = this.aPPROVALSTATUS;
data['APPROVER'] = this.aPPROVER;
data['APPROVER_CATEGORY'] = this.aPPROVERCATEGORY;
data['APPROVER_ORDER_NUMBER'] = this.aPPROVERORDERNUMBER;
data['APPROVER_TYPE'] = this.aPPROVERTYPE;
data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE;
data['FROM_ROW_NUM'] = this.fROMROWNUM;
data['LINE_NO'] = this.lINENO;
data['NO_OF_ROWS'] = this.nOOFROWS;
data['POSITION_TITLE'] = this.pOSITIONTITLE;
data['ROW_NUM'] = this.rOWNUM;
data['TO_ROW_NUM'] = this.tOROWNUM;
return data;
}
}

@ -0,0 +1,28 @@
class GetDefaultValueList {
String? pIDCOLUMNNAME;
String? pRETURNMSG;
String? pRETURNSTATUS;
String? pVALUECOLUMNNAME;
GetDefaultValueList(
{this.pIDCOLUMNNAME,
this.pRETURNMSG,
this.pRETURNSTATUS,
this.pVALUECOLUMNNAME});
GetDefaultValueList.fromJson(Map<String, dynamic> json) {
pIDCOLUMNNAME = json['P_ID_COLUMN_NAME'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pVALUECOLUMNNAME = json['P_VALUE_COLUMN_NAME'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME;
return data;
}
}

@ -83,8 +83,6 @@ class GetEITDFFStructureList {
this.fieldAnswer});
GetEITDFFStructureList.fromJson(Map<String, dynamic> json) {
print("----------------==============================");
print("----------------:$json");
aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG'];
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
cHILDSEGMENTSDV = json['CHILD_SEGMENTS_DV'];
@ -207,6 +205,8 @@ class GetEITDFFStructureList {
data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP;
return data;
}
bool get isDefaultTypeIsCDPS => (dEFAULTTYPE == "C" || dEFAULTTYPE == "D" || dEFAULTTYPE == "P" || dEFAULTTYPE == "S");
}
class ESERVICESDV {

@ -9,6 +9,8 @@ class PostParamsModel {
String? pEmailAddress;
String? pUserName;
String? pSelectedEmployeeNumber;
String? pLegislationCode;
String? payrollCodeStr;
int? pSessionId;
String? userName;
@ -25,6 +27,8 @@ class PostParamsModel {
this.pSessionId,
this.pUserName,
this.pSelectedEmployeeNumber,
this.payrollCodeStr,
this.pLegislationCode,
});
PostParamsModel.fromJson(Map<String, dynamic> json) {
@ -33,6 +37,8 @@ class PostParamsModel {
languageID = json['LanguageID'];
mobileType = json['MobileType'];
logInTokenID = json['LogInTokenID'];
payrollCodeStr = json['payrollCodeStr'];
pLegislationCode = json['LegislationCodeStr'];
tokenID = json['TokenID'];
}
@ -43,6 +49,8 @@ class PostParamsModel {
data['LanguageID'] = this.languageID;
data['MobileType'] = this.mobileType;
data['LogInTokenID'] = this.logInTokenID;
data['payrollCodeStr'] = this.payrollCodeStr;
data['LegislationCodeStr'] = this.pLegislationCode;
data['TokenID'] = this.tokenID;
return data;
}
@ -59,9 +67,10 @@ class PostParamsModel {
data['UserName'] = this.userName;
data['P_EMAIL_ADDRESS'] = this.pEmailAddress;
data['P_SESSION_ID'] = this.pSessionId;
data['payrollCodeStr'] = this.payrollCodeStr;
data['LegislationCodeStr'] = this.pLegislationCode;
data['P_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber;
data['P_USER_NAME'] = this.pUserName;
return data;
}
@ -80,4 +89,8 @@ class PostParamsModel {
set setPUserName(String? v) => pUserName = v;
set setPSelectedEmployeeNumber(String? v) => pSelectedEmployeeNumber = v;
set setPLegislationCode(String? v) => pLegislationCode = v;
set setPayrollCodeStr(String? v) => payrollCodeStr = v;
}

@ -0,0 +1,18 @@
class StartEitApprovalProcess {
String? pRETURNMSG;
String? pRETURNSTATUS;
StartEitApprovalProcess({this.pRETURNMSG, this.pRETURNSTATUS});
StartEitApprovalProcess.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -0,0 +1,28 @@
class SubmitEITTransactionList {
String? pITEMKEY;
String? pRETURNMSG;
String? pRETURNSTATUS;
int? pTRANSACTIONID;
SubmitEITTransactionList(
{this.pITEMKEY,
this.pRETURNMSG,
this.pRETURNSTATUS,
this.pTRANSACTIONID});
SubmitEITTransactionList.fromJson(Map<String, dynamic> json) {
pITEMKEY = json['P_ITEM_KEY'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ITEM_KEY'] = this.pITEMKEY;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -0,0 +1,18 @@
class ValidateEITTransactionList {
String? pRETURNMSG;
String? pRETURNSTATUS;
ValidateEITTransactionList({this.pRETURNMSG, this.pRETURNSTATUS});
ValidateEITTransactionList.fromJson(Map<String, dynamic> json) {
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
return data;
}
}

@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:flutter/material.dart';
class DrawerItem extends StatefulWidget {

@ -85,10 +85,10 @@ class ServicesWidget extends StatelessWidget {
)
],
).paddingOnly(left: 10, right: 10, bottom: 10, top: 12),
),
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
});
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
}),
);
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length),
@ -108,7 +108,13 @@ class ServicesWidget extends StatelessWidget {
}
void handleOnPress(context, GetMenuEntriesList menuEntry) {
print(menuEntry.menuName);
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
List<GetMenuEntriesList>? menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && element.menuEntryType == "FUNCTION").toList();
menuEntry.icon = "";
print(menuEntry.toJson());
Navigator.pushNamed(context, AppRoutes.myAttendance, arguments: menuList ?? []);
return;
if (menuEntry.menuName == "HMG_OTL_SS" || menuEntry.menuName == "HMG_PT_OTL_SS") {
Navigator.pushNamed(context, AppRoutes.myAttendance);
} else {

@ -132,10 +132,9 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
// username.text = "15153";
username.text = "15153";
password.text = "Abcd@1234";
username.text = "15444";
// username.text = "15444";
return Scaffold(
body: Column(

@ -0,0 +1,259 @@
import 'dart:convert';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.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/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/attachment_model.dart';
import 'package:mohem_flutter_app/models/get_approves_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/button/simple_button.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
class RequestSubmitScreenParams {
String title;
int transactionId;
String pItemId;
RequestSubmitScreenParams(this.title, this.transactionId, this.pItemId);
}
class RequestSubmitScreen extends StatefulWidget {
RequestSubmitScreen({Key? key}) : super(key: key);
@override
_RequestSubmitScreenState createState() {
return _RequestSubmitScreenState();
}
}
class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
RequestSubmitScreenParams? params;
TextEditingController comments = TextEditingController();
List<GetApprovesList> approverList = [];
List<File> attachmentFiles = [];
@override
void initState() {
super.initState();
}
void getApproverList() async {
try {
Utils.showLoading(context);
approverList = await MyAttendanceApiClient().getApproversList("SSHRMS", params!.transactionId);
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void submitRequest() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> list = [];
if (attachmentFiles.isNotEmpty) {
attachmentFiles.asMap().forEach((index, value) async {
String type = value.path.split('.').last;
String name = value.path.split('/').last;
List<int> fileContent = await value.readAsBytes();
String encodedFile = base64Encode(fileContent);
list.add(AttachmentModel(
attachmentID: index,
pFILECONTENTTYPE: type,
pFILENAME: name,
pFILEDATA: encodedFile,
pTRANSACTIONID: params!.transactionId,
).toJson());
});
}
await MyAttendanceApiClient().addAttachment(list);
await MyAttendanceApiClient().startEitApprovalProcess(
"SUBMIT",
comments.text,
params!.pItemId,
params!.transactionId,
);
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourRequestHasBeenSubmittedForApprovals.tr(), longDuration: true);
Navigator.of(context).popUntil((route) {
return route.settings.name == AppRoutes.dashboard;
});
Navigator.pushNamed(context, AppRoutes.workList);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
if (params == null) {
params = ModalRoute.of(context)!.settings.arguments as RequestSubmitScreenParams;
getApproverList();
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: params!.title,
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.all(21).copyWith(top: 14),
physics: const BouncingScrollPhysics(),
children: [
attachmentView("Attachments"),
14.height,
InputWidget(
LocaleKeys.comments.tr(),
LocaleKeys.writeComment.tr(),
comments,
isBackgroundEnable: true,
lines: 3,
onChange: (String note) {
// this.note = note;
},
), //.objectContainerView(title: "Comments"),
14.height,
LocaleKeys.approversList.tr().toSectionHeading(),
14.height,
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
return approverView(cxt, approverList[index]);
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: approverList.length,
)
],
).expanded,
DefaultButton(
LocaleKeys.submit.tr(),
() {
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(
message: LocaleKeys.areYouSureYouWantToSubmit.tr(),
onTap: () {
Navigator.pop(context);
submitRequest();
},
),
);
},
).insideContainer,
],
),
);
}
Widget approverView(BuildContext context, GetApprovesList approver) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircularAvatar(url: approver.eMPLOYEEIMAGE, isImageBase64: true, height: 40, width: 40),
9.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
approver.aPPROVER!.toText16(),
approver.pOSITIONTITLE!.toText12(color: MyColors.lightTextColor),
],
),
)
],
).objectContainerView();
}
Widget attachmentView(String title) {
return Container(
padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
title.toText16().expanded,
6.width,
SimpleButton("Add", () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
if (result != null) {
attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList();
attachmentFiles = attachmentFiles.toSet().toList();
setState(() {});
}
}, fontSize: 14),
],
),
if (attachmentFiles.isNotEmpty) 12.height,
if (attachmentFiles.isNotEmpty)
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) {
String fileName = attachmentFiles[index].path.split('/').last;
return Row(
children: [
fileName.toText13().expanded,
6.width,
IconButton(
padding: EdgeInsets.zero,
iconSize: 20,
icon: const Icon(Icons.cancel_rounded),
color: MyColors.redColor,
constraints: const BoxConstraints(),
onPressed: () async {
attachmentFiles.removeAt(index);
setState(() {});
},
)
],
);
},
separatorBuilder: (cxt, index) => 6.height,
itemCount: attachmentFiles.length),
],
),
);
}
}

@ -5,13 +5,17 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.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/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart';
import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
@ -50,20 +54,58 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
}
void validateTransaction() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (e.fORMATTYPE == "X") {
// for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
if (tempVar.isNotEmpty) {
DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar);
tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
}
}
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson();
}).toList();
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.forEach((element) {
print(element);
});
genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!));
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
String dESCFLEXCONTEXTCODE = "";
void calGetValueSetValues(GetEITDFFStructureList structureList) async {
try {
Utils.showLoading(context);
String segmentId = structureList.cHILDSEGMENTSVS!;
dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!;
List<GetEITDFFStructureList> filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? [];
List<Map<String, dynamic>> values = filteredList
.map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson())
.toList();
ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
ESERVICESVS eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
getEitDffStructureList = abc;
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS);
getEitDffStructureList![index].eSERVICESVS!.add(genericResponseModel);
getEitDffStructureList![index].eSERVICESVS!.clear();
getEitDffStructureList![index].eSERVICESVS!.add(eServicesResponseModel);
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
Utils.hideLoading(context);
@ -74,6 +116,36 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
}
void getDefaultValues(GetEITDFFStructureList structureList) async {
if ((structureList.cHILDSEGMENTSDVSplited?.length ?? 0) < 1) {
return;
}
try {
Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
GetEITDFFStructureList? reqObj = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
List<PARENTSEGMENTSDVSplited> parentRequired = reqObj.pARENTSEGMENTSDVSplited ?? [];
List<GetEITDFFStructureList> filteredList =
getEitDffStructureList!.where((outerElement) => parentRequired.any((element) => outerElement.sEGMENTNAME == element.name && element.isRequired == "REQUIRED")).toList();
List<Map<String, dynamic>> values = filteredList
.map((e) => GetSetValuesRequestModel(
sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME)
.toJson())
.toList();
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
getEitDffStructureList![index].eSERVICESDV = defaultValue;
}
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override
void dispose() {
super.dispose();
@ -109,9 +181,11 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
LocaleKeys.next.tr(),
(getEitDffStructureList ?? []).isEmpty
? null
: () => {
//Navigator.of(context).pushNamed(LOGIN_TYPE)
},
: () {
validateTransaction();
//Navigator.of(context).pushNamed(LOGIN_TYPE)
},
).insideContainer,
],
),
@ -120,30 +194,157 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Widget parseDynamicFormatType(GetEITDFFStructureList model, int index) {
if (model.dISPLAYFLAG != "N") {
if (model.vALIDATIONTYPE == "N") {
if (model.fORMATTYPE == "C") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
onChange: (text) {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "N") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
isReadOnly: model.rEADONLY == "Y",
isInputTypeNum: true,
onChange: (text) {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy-MM-dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
}
} else {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
],
onSelected: (int popipIndex) {
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![popipIndex].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
getDefaultValues(model);
}
});
}
} else {
return const SizedBox();
}
if (model.fORMATTYPE == "C") {
if (model.fORMATTYPE == "N") {
if (model.eSERVICESVS?.isNotEmpty ?? false) {
return PopupMenuButton(
child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
isEnable: false,
isPopup: true,
isInputTypeNum: true,
isReadOnly: model.rEADONLY == "Y",
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
],
onSelected: (int index) {
onSelected: (int popipIndex) {
ESERVICESDV eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME,
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME);
print(model.eSERVICESVS![index].toJson());
pRETURNSTATUS: getEitDffStructureList![popipIndex].dEFAULTVALUE,
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
getDefaultValues(model);
}
});
}
@ -155,13 +356,29 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
model.fieldAnswer = text;
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "X") {
} else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? "");
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
if (displayText.contains(" 00:00:00")) {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
displayText,
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getEitDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
DateTime date1 = DateTime(date.year, date.month, date.day);
getEitDffStructureList![index].fieldAnswer = date.toString();
@ -169,7 +386,34 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1),
pRETURNMSG: "null",
pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? DateFormat('yyyy-MM-dd hh:mm:ss').format(date) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
calGetValueSetValues(model);
}
},
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "I") {
return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""),
suffixIconData: Icons.access_time_filled_rounded,
isEnable: false,
onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1]));
//DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
TimeOfDay _time = await _selectTime(context);
DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute);
String time = DateFormat('HH:mm').format(tempTime).trim();
// DateTime date1 = DateTime(date.year, date.month, date.day);
// getEitDffStructureList![index].fieldAnswer = date.toString();
ESERVICESDV eservicesdv = ESERVICESDV(pIDCOLUMNNAME: time, pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: time);
getEitDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
@ -217,4 +461,45 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
return time;
}
Future<TimeOfDay> _selectTime(BuildContext context) async {
TimeOfDay time = TimeOfDay(hour: selectedDate.hour, minute: selectedDate.minute);
if (!Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (cxt) => Container(
height: 250,
color: Colors.white,
child: CupertinoDatePicker(
backgroundColor: Colors.white,
mode: CupertinoDatePickerMode.time,
use24hFormat: true,
onDateTimeChanged: (value) {
if (value != null && value != selectedDate) {
time = TimeOfDay(hour: value.hour, minute: value.minute);
}
},
initialDateTime: selectedDate,
),
),
);
} else {
final TimeOfDay? picked = await showTimePicker(
context: context,
initialTime: time,
builder: (cxt, child) {
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container());
});
if (picked != null && picked != time) {
time = picked;
}
// final DateTime? picked =
// await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
// if (picked != null && picked != selectedDate) {
// time = picked;
// }
}
return time;
}
}

@ -18,6 +18,7 @@ class DynamicListViewParams {
String uRL;
String requestID;
String colsURL;
DynamicListViewParams(this.title, this.dynamicId, {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = ''});
}
@ -33,6 +34,7 @@ class DynamicListViewScreen extends StatefulWidget {
class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
List<GetEITTransactionList>? getEITTransactionList;
DynamicListViewParams? dynamicParams;
@override
void initState() {
super.initState();
@ -42,6 +44,9 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
try {
Utils.showLoading(context);
getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId);
getEITTransactionList?.forEach((element) {
element.collectionTransaction = element.collectionTransaction?.where((elemen) => elemen.dISPLAYFLAG == "Y").toList() ?? [];
});
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -74,17 +79,19 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
? LocaleKeys.noDataAvailable.tr().toText16().center
: ListView.separated(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
itemBuilder: (cxt, int parentIndex) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
padding: const EdgeInsets.all(21),
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
ItemDetailView(
getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
floatingActionButton: Container(

@ -7,14 +7,18 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
class MyAttendanceScreen extends StatelessWidget {
MyAttendanceScreen({Key? key}) : super(key: key);
List<GetMenuEntriesList> list;
MyAttendanceScreen({Key? key, this.list = const <GetMenuEntriesList>[]}) : super(key: key);
@override
Widget build(BuildContext context) {
list = ModalRoute.of(context)!.settings.arguments as List<GetMenuEntriesList>;
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
@ -24,36 +28,31 @@ class MyAttendanceScreen extends StatelessWidget {
body: SizedBox(
width: double.infinity,
height: double.infinity,
child: ListView(
children: [
itemView(
"assets/images/pdf.svg",
LocaleKeys.monthlyAttendance.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
}),
12.height,
itemView(
"assets/images/pdf.svg",
LocaleKeys.missingSwipes.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
12.height,
itemView(
"assets/images/pdf.svg",
LocaleKeys.workFromHome.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.workFromHome.tr(), "HMG_OTL_WFH_EIT_SS"));
}),
12.height,
itemView(
"assets/images/pdf.svg",
LocaleKeys.workOnBreak.tr(),
),
],
).paddingAll(21)),
child: list.isEmpty
? LocaleKeys.noDataAvailable.tr().toText16().center
: Column(
children: [
itemView(
"assets/images/pdf.svg",
LocaleKeys.missingSwipes.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
12.height,
ListView.separated(
padding: const EdgeInsets.all(21),
itemBuilder: (cxt, index) => itemView(
"assets/images/pdf.svg",
//LocaleKeys.missingSwipes.tr(),
list[index].prompt!,
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(list[index].prompt!, list[index].functionName!));
}),
separatorBuilder: (cxt, index) => 12.height,
itemCount: list.length)
.expanded
],
)),
);
}

@ -1,819 +0,0 @@
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_html/flutter_html.dart';
// import 'package:flutter_svg/flutter_svg.dart';
// import 'package:shared_preferences/shared_preferences.dart';
// import 'package:tangheem/api/admin_configuration_api_client.dart';
// import 'package:tangheem/api/tangheem_user_api_client.dart';
// import 'package:tangheem/app_state/app_state.dart';
// import 'package:tangheem/classes/colors.dart';
// import 'package:tangheem/classes/consts.dart';
// import 'package:tangheem/classes/utils.dart';
// import 'package:tangheem/extensions/string_extensions.dart';
// import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
// import 'package:tangheem/models/discussion_model.dart';
// import 'package:tangheem/ui/dialogs/discussion_input_dialog.dart';
// import 'package:tangheem/widgets/aya_player_widget.dart';
// import 'package:tangheem/widgets/aya_record_widget.dart';
// import 'package:tangheem/widgets/text_highlight_widget.dart';
//
// import 'login_screen.dart';
//
// class TangheemDetailParams {
// final String selectedTangheemTypeId;
// final List<AyatTangheemTypeMappedData> ayatTangheemTypeMappedDataList;
//
// TangheemDetailParams({@required this.selectedTangheemTypeId, @required this.ayatTangheemTypeMappedDataList});
// }
//
// class TangheemDetailScreen extends StatefulWidget {
// static const String routeName = "/tangheem_detail";
// final TangheemDetailParams tangheemDetailParams;
//
// TangheemDetailScreen({Key key, this.tangheemDetailParams}) : super(key: key);
//
// @override
// _TangheemDetailScreenState createState() {
// return _TangheemDetailScreenState();
// }
// }
//
// class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
// GlobalKey _globalKey = GlobalKey();
//
// List<VoiceNote> voiceNoteList = [];
//
// List<AyatTangheemTypeMappedData> ayatTangheemTypeMappedDataList = [];
//
// List<AyatTangheemTypeMappedData> _dataList = [];
//
// int _discussionPage = -1;
// AyatTangheemTypeMappedData _ayatTangheemTypeMappedFirstData;
// DiscussionModel _discussionModel;
//
// bool showAyaPlayer = false;
//
// @override
// void initState() {
// super.initState();
// ayatTangheemTypeMappedDataList = widget.tangheemDetailParams.ayatTangheemTypeMappedDataList;
// _ayatTangheemTypeMappedFirstData = ayatTangheemTypeMappedDataList.first;
// filterVoiceListData();
// getPrefs();
// getTangheemDiscussionAndRelatedData();
// }
//
// double fontSize = 18;
//
// SharedPreferences prefs;
//
// void getPrefs() async {
// prefs = await SharedPreferences.getInstance();
// fontSize = (prefs.getInt(GlobalConsts.fontZoomSize) ?? 18) + 0.0;
// setState(() {});
// }
//
// String getArabicIndexWord(int index) {
// if (index == 0) {
// return 'الأولى';
// } else if (index == 1) {
// return 'الثانية';
// } else if (index == 2) {
// return 'الثالثة';
// } else if (index == 3) {
// return 'الرابعة';
// } else if (index == 4) {
// return 'الخامسة';
// }
// return "";
// }
//
// void getTangheemDiscussionAndRelatedData() async {
// Utils.showLoading(context);
// try {
// _discussionModel = await TangheemUserApiClient().getDiscussionByTangheemID(_discussionPage, widget.tangheemDetailParams.selectedTangheemTypeId);
// if (!_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs.contains(",")) {
// _dataList = await getTangheemRelatedData();
// }
// Utils.hideLoading(context);
// setState(() {});
// } catch (ex) {
// print(ex);
// Utils.handleException(ex, context, null);
// Utils.hideLoading(context);
// }
// }
//
// Future<List<AyatTangheemTypeMappedData>> getTangheemRelatedData() async {
// _dataList = [];
// AyatTangheemTypeMapped _ayatTangheemTypeMapped =
// await TangheemUserApiClient().getAyaTangheemTypeMappedRelated(_ayatTangheemTypeMappedFirstData.surahNo, _ayatTangheemTypeMappedFirstData.ayatNumberInSurahs);
// _dataList = _ayatTangheemTypeMapped?.data ?? [];
// if (_dataList.isNotEmpty) {
// _dataList = _dataList.where((element) => element.tangheemTypeId != _ayatTangheemTypeMappedFirstData.tangheemTypeId)?.toList() ?? [];
// var _tempList = _dataList.map((e) => e.tangheemTypeId).toList().toSet().toList();
// var _dataTempList = <AyatTangheemTypeMappedData>[];
// _tempList.forEach((_tempElement) {
// _dataTempList.add(_dataList.firstWhere((element) {
// return !element.ayatNumberInSurahs.contains(",") && (element.tangheemTypeId == _tempElement);
// }, orElse: null));
// });
// _dataList = _dataTempList;
// }
//
// return _dataList;
// }
//
// void sendComment(String discussionText) async {
// Utils.showLoading(context);
// try {
// await AdminConfigurationApiClient().addDiscussion(discussionText, _ayatTangheemTypeMappedFirstData.ayaTangheemTypeId);
// Utils.showToast("تم إرسال التعليق ، سيكون مرئيًا بمجرد موافقة المسؤول عليه");
// Utils.hideLoading(context);
// Navigator.pop(context);
// } catch (ex) {
// Utils.handleException(ex, context, null);
// Utils.hideLoading(context);
// }
// }
//
// void filterVoiceListData() {
// ayatTangheemTypeMappedDataList.forEach((element) {
// voiceNoteList.addAll(element.voiceNote);
// });
// }
//
// @override
// void dispose() {
// super.dispose();
// }
//
// @override
// Widget build(BuildContext context) {
// return Container(
// padding: EdgeInsets.fromLTRB(16, 0, 16, 0),
// width: double.infinity,
// child: _ayatTangheemTypeMappedFirstData == null
// ? SizedBox()
// : Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// child: ListView(
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.only(bottom: 16, top: 16),
// children: [
// Text(
// _ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// SizedBox(height: 8),
// Text(
// _ayatTangheemTypeMappedFirstData.tangheemTypeDescription ?? "",
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1),
// ),
// SizedBox(height: 8),
// Container(
// margin: EdgeInsets.only(top: 4, bottom: 4),
// padding: EdgeInsets.only(top: 8, bottom: 8, right: 4, left: 4),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: SingleChildScrollView(
// physics: NeverScrollableScrollPhysics(),
// child: RepaintBoundary(
// key: _globalKey,
// child: Material(
// color: Colors.white,
// child: ListView.builder(
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: ayatTangheemTypeMappedDataList.length > 5 ? 5 : ayatTangheemTypeMappedDataList.length,
// itemBuilder: (context, index) {
// var _ayatTangheemTypeMappedData = ayatTangheemTypeMappedDataList[index];
// List<TangheemProperty> _tangheemInsideTableList = [];
// List<TangheemProperty> _tangheemAboveTableList = [];
// List<TangheemProperty> _tangheemBelowTableList = [];
// List<String> _tangheemWords = [];
//
// List<TangheemProperty> _tempPropertyList = List<TangheemProperty>() + _ayatTangheemTypeMappedData?.property ?? [];
// int firstIndex = _tempPropertyList.indexWhere((element) => element.isInsideTable);
// if (firstIndex >= 0) {
// var _tempPropertyListTop = _tempPropertyList.take(firstIndex);
// _tempPropertyListTop = _tempPropertyListTop.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemAboveTableList = _tempPropertyListTop;
// _tempPropertyListTop.forEach((element) {
// _tempPropertyList.remove(element);
// });
// var _tempPropertyListInside = _tempPropertyList?.where((element) => (element.isInsideTable))?.toList() ?? [];
// _tempPropertyListInside.forEach((element) {
// _tempPropertyList.remove(element);
// });
// _tempPropertyListInside = _tempPropertyListInside.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemInsideTableList = _tempPropertyListInside;
// var _tempPropertyListBelow = _tempPropertyList;
// _tempPropertyListBelow = _tempPropertyListBelow.where((element) => (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// _tangheemBelowTableList = _tempPropertyListBelow;
// }
//
// _tangheemWords.add(_ayatTangheemTypeMappedData.highlightText ?? "");
// // _tangheemInsideTableList =
// // _ayatTangheemTypeMappedData?.property?.where((element) => (element.isInsideTable) && (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// // _tangheemAboveTableList =
// // _ayatTangheemTypeMappedData?.property?.where((element) => (!element.isInsideTable) && (element.propertyValue ?? "").isNotEmpty)?.toList() ?? [];
// //
// //
//
// var _tempTangheemIndexWord = "";
// if (ayatTangheemTypeMappedDataList.length == 1) {
// _tempTangheemIndexWord = "";
// } else {
// _tempTangheemIndexWord = getArabicIndexWord(index) + " ";
// }
//
// return ListView(
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// padding: EdgeInsets.all(4),
// children: [
// Row(
// children: [
// Text(
// " جملة ${_ayatTangheemTypeMappedData.tangheemTypeName} $_tempTangheemIndexWord",
// style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, backgroundColor: ColorConsts.primaryBlue),
// ),
// Expanded(
// child: Container(height: 2, color: ColorConsts.primaryBlue),
// ),
// ],
// ),
// SizedBox(height: 8),
// TextHighLightWidget(
// text: _ayatTangheemTypeMappedData.reverseAyatNumber() ?? "",
// valueColor: ColorConsts.primaryBlue,
// highlights: _tangheemWords,
// highLightFontSize: fontSize,
// style: TextStyle(
// fontFamily: "UthmanicHafs",
// fontSize: fontSize,
// fontWeight: FontWeight.bold,
// ),
// ),
// SizedBox(height: 16),
// ListView.separated(
// itemCount: _tangheemAboveTableList.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// separatorBuilder: (context, index) {
// return Divider(
// color: Colors.white,
// height: 4,
// thickness: 0,
// );
// },
// itemBuilder: (context, index) {
// return Row(
// children: [
// Expanded(
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 4, right: 8),
// alignment: Alignment.centerRight,
// child: Text(
// _tangheemAboveTableList[index].propertyText,
// maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, color: ColorConsts.secondaryOrange),
// ),
// color: ColorConsts.secondaryWhite,
// ),
// ),
// SizedBox(width: 4),
// Expanded(
// child: Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 4, right: 8),
// // alignment: Alignment.centerRight,
// child: Html(
// data: _tangheemAboveTableList[index]?.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
//
// // Text(
// // _tangheemAboveTableList[index].propertyValue,
// // maxLines: 1,
// // style: TextStyle(
// // color: Color(
// // Utils.stringToHex(_tangheemAboveTableList[index].textColor),
// // ),
// // ),
// // ),
// ),
// ),
// )
// ],
// );
// }),
// if (_tangheemInsideTableList.isNotEmpty)
// Container(
// color: ColorConsts.primaryBlue,
// margin: EdgeInsets.only(top: 8, bottom: 8),
// padding: EdgeInsets.all(8),
// child: Column(
// children: [
// Text(
// "خط النبر و التنغيم ل${_ayatTangheemTypeMappedData.tangheemTypeName ?? ""}",
// style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
// ),
// SizedBox(height: 8),
// tangheemInsideTablePropertyView(_tangheemInsideTableList)
// ],
// ),
// ),
// tangheemOutSideTablePropertyView(_tangheemBelowTableList)
// ],
// );
// }),
// ),
// ),
// ),
// ),
// SizedBox(height: 8),
// discussionView(_discussionModel?.data ?? []),
// if (_dataList.isNotEmpty)
// Container(
// margin: EdgeInsets.only(top: 8),
// padding: EdgeInsets.only(bottom: 20),
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: Column(
// children: [
// Container(
// height: 60,
// width: double.infinity,
// margin: EdgeInsets.only(bottom: 8),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: ColorConsts.primaryBlue,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(8),
// topRight: Radius.circular(8),
// ),
// ),
// child: Text(
// "قائمة الأساليب اللغوية في هذه الآية",
// style: TextStyle(fontSize: 16, color: Colors.white),
// ),
// ),
// ListView.separated(
// padding: EdgeInsets.fromLTRB(4, 8, 4, 4),
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: _dataList.length,
// separatorBuilder: (context, index) => SizedBox(height: 16),
// itemBuilder: (context, index) {
// return InkWell(
// onTap: () {
// List<AyatTangheemTypeMappedData> list = _dataList;
// var removedData = list[index];
// list.remove(removedData);
// list.insert(0, removedData);
// TangheemDetailParams tangheem = TangheemDetailParams(selectedTangheemTypeId: _dataList[index].ayaTangheemTypeId, ayatTangheemTypeMappedDataList: list);
// Navigator.pushNamed(context, TangheemDetailScreen.routeName, arguments: tangheem);
// },
// child: Text(
// _dataList[index].tangheemTypeName,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: ColorConsts.secondaryOrange, height: 1.5),
// ),
// );
// },
// ),
// ],
// ),
// ),
// SizedBox(height: 16),
// AyaRecordWidget()
// ],
// ),
// ),
// if (MediaQuery.of(context).orientation == Orientation.portrait)
// AyaPlayerWidget(
// surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "",
// ayaTangheemTypeId: _ayatTangheemTypeMappedFirstData?.ayaTangheemTypeId ?? "",
// globalKey: _globalKey,
// ayaNo: _ayatTangheemTypeMappedFirstData?.ayahNo,
// surahNo: _ayatTangheemTypeMappedFirstData?.surahNo,
// voiceNoteList: voiceNoteList),
// if (MediaQuery.of(context).orientation == Orientation.landscape)
// Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// height: 24,
// margin: EdgeInsets.only(bottom: 8, top: 8),
// // color: Colors.transparent,
// child: TextButton(
// onPressed: () {
// setState(() {
// showAyaPlayer = !showAyaPlayer;
// });
// },
// child: Text(
// showAyaPlayer ? "إخفاء التسجيلات" : "إظهار التسجيلات",
// style: TextStyle(color: Colors.black87, fontSize: 12),
// ),
// style: TextButton.styleFrom(
// backgroundColor: ColorConsts.gradientOrange,
// primary: ColorConsts.primaryBlue,
// padding: EdgeInsets.only(top: 4, bottom: 4, right: 8, left: 8),
// textStyle: TextStyle(color: Colors.white, fontSize: 12),
// ),
// ),
// ),
// if (showAyaPlayer)
// AyaPlayerWidget(
// surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "",
// ayaTangheemTypeId: _ayatTangheemTypeMappedFirstData?.ayaTangheemTypeId ?? "",
// ayaNo: _ayatTangheemTypeMappedFirstData?.ayahNo,
// surahNo: _ayatTangheemTypeMappedFirstData?.surahNo,
// globalKey: _globalKey,
// voiceNoteList: voiceNoteList),
// ],
// )
// ],
// ),
// );
// }
//
// Widget nextOptionButton(String icon, String text, VoidCallback onPressed) {
// return InkWell(
// onTap: onPressed,
// child: onPressed == null
// ? SizedBox()
// : Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// SvgPicture.asset(icon, height: 12, width: 12),
// SizedBox(width: 4),
// Text(
// text,
// style: TextStyle(color: ColorConsts.textGrey),
// ),
// ],
// ),
// );
// }
//
// Widget previousOptionButton(String icon, String text, VoidCallback onPressed) {
// return InkWell(
// onTap: onPressed,
// child: onPressed == null
// ? SizedBox()
// : Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// text,
// style: TextStyle(color: ColorConsts.textGrey),
// ),
// SizedBox(width: 4),
// SvgPicture.asset(icon, height: 12, width: 12),
// ],
// ),
// );
// }
//
// Widget tangheemOutSideTablePropertyView(List<TangheemProperty> tangheemPropertyList) {
// return ListView.separated(
// itemCount: tangheemPropertyList.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// separatorBuilder: (context, index) {
// return Divider(
// color: Colors.white,
// height: 4,
// thickness: 0,
// );
// },
// itemBuilder: (context, index) {
// return Row(
// children: [
// Expanded(
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 4, right: 8),
// alignment: Alignment.centerRight,
// child: Text(
// tangheemPropertyList[index].propertyText,
// maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, color: ColorConsts.secondaryOrange),
// ),
// color: ColorConsts.secondaryWhite,
// ),
// ),
// SizedBox(width: 4),
// Expanded(
// child: Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 4, right: 8),
// // alignment: Alignment.centerRight,
// child: Html(
// data: tangheemPropertyList[index]?.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
// // Text(
// // tangheemPropertyList[index].propertyValue,
// // maxLines: 1,
// // style: TextStyle(
// // color: Color(
// // Utils.stringToHex(tangheemPropertyList[index].textColor),
// // ),
// // ),
// // ),
// ),
// ),
// )
// ],
// );
// });
// }
//
// Widget tangheemInsideTablePropertyView(List<TangheemProperty> tangheemPropertyList) {
// return Container(
// color: Colors.white,
// padding: EdgeInsets.all(2),
// child: Row(
// children: [
// for (var property in tangheemPropertyList)
// Expanded(
// child: Container(
// // color: ColorConsts.secondaryWhite,
// // padding: EdgeInsets.all(8),
// margin: EdgeInsets.only(left: 2, right: 2),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// color: ColorConsts.secondaryWhite,
// //height: 30,
// alignment: Alignment.center,
// padding: EdgeInsets.only(left: 2, right: 4),
// width: double.infinity,
// child: Text(
// property.propertyText ?? "",
// // maxLines: 1,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12, color: ColorConsts.secondaryOrange),
// ),
// ),
// Container(width: double.infinity, height: 4, color: Colors.white),
// Container(
// color: ColorConsts.secondaryWhite,
// padding: EdgeInsets.all(4),
// child: Container(
// color: Colors.white,
// padding: EdgeInsets.only(left: 2, right: 4),
// width: double.infinity,
// child: Html(
// data: property.propertyValue ?? "",
// style: {
// 'html': Style(textAlign: TextAlign.left),
// },
// ),
//
// // Text(
// // property.propertyValue ?? "",
// // maxLines: 1,
// // style: TextStyle(
// // fontSize: 12,
// // color: Color(
// // Utils.stringToHex(property.textColor),
// // ),
// // ),
// // ),
// ),
// ),
// ],
// ),
// ),
// )
// ],
// )
//
// //@todo sikander :commented these line for later discussion
// // ListView.separated(
// // itemCount: tangheemPropertyList.length,
// // physics: NeverScrollableScrollPhysics(),
// // padding: EdgeInsets.zero,
// // shrinkWrap: true,
// // separatorBuilder: (context, index) {
// // return Divider(
// // color: Colors.white,
// // height: 1,
// // thickness: 0,
// // );
// // },
// // itemBuilder: (context, index) {
// // return Container(
// // color: ColorConsts.secondaryWhite,
// // padding: EdgeInsets.all(8),
// // child: Column(
// // mainAxisSize: MainAxisSize.min,
// // crossAxisAlignment: CrossAxisAlignment.start,
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // Text(
// // tangheemPropertyList[index].propertyText ?? "",
// // style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12, color: ColorConsts.secondaryOrange),
// // ),
// // SizedBox(height: 4),
// // Text(
// // tangheemPropertyList[index].propertyValue ?? "",
// // style: TextStyle(
// // fontSize: 12,
// // color: Color(
// // Utils.stringToHex(tangheemPropertyList[index].textColor),
// // ),
// // ),
// // ),
// // ],
// // ),
// // );
// // },
// // ),
// );
// }
//
// Widget discussionView(List<DiscussionModelData> _discussionList) {
// _discussionList = _discussionList.where((element) => element.status.toLowerCase() == "Accept".toLowerCase()).toList();
// return Stack(
// alignment: Alignment.bottomCenter,
// children: [
// Container(
// margin: EdgeInsets.only(top: 4, bottom: 25),
// padding: EdgeInsets.all(8),
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// ),
// child: _discussionList.length > 0
// ? ListView.separated(
// padding: EdgeInsets.only(top: 4, bottom: 24),
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: _discussionList.length,
// separatorBuilder: (context, index) => SizedBox(height: 16),
// itemBuilder: (context, index) {
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Row(
// children: [
// SvgPicture.asset(
// "assets/icons/chat_user.svg",
// width: 60,
// height: 60,
// ),
// SizedBox(width: 8),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "تعليق على الآية ${_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs}",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// SizedBox(height: 4),
// Directionality(
// textDirection: TextDirection.ltr,
// child: Text(
// _discussionList[index].date.toFormattedDate(),
// style: TextStyle(fontSize: 12, color: ColorConsts.textGrey, height: 1),
// ),
// ),
// ],
// )
// ],
// ),
// SizedBox(height: 4),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// "تعليق من: " + _discussionList[index].userName,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// Text(
// _discussionList[index].discussionText,
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
// ),
// if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty) SizedBox(height: 4),
// if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty)
// Text(
// "رد من المسؤول: " + _discussionList[index].adminResponse,
// style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
// ),
// ],
// )
// ],
// );
// },
// )
// : Text(
// "لا يوجد تعليقات",
// style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue, height: 1.5),
// ),
// ),
// Positioned(
// bottom: 0,
// child: InkWell(
// borderRadius: BorderRadius.circular(30),
// onTap: () async {
// if (!AppState().isUserLogin) {
// Widget cancelButton = FlatButton(
// child: Text("أرغب بالتسجيل"),
// onPressed: () async {
// Navigator.pop(context);
// await Navigator.pushNamed(context, LoginScreen.routeName);
// if (!AppState().isUserLogin) {
// return;
// }
// },
// );
// Widget continueButton = FlatButton(
// child: Text("استمرار كضيف"),
// onPressed: () {
// Navigator.pop(context);
// return;
// },
// );
//
// AlertDialog alert = AlertDialog(
// content: Text("هذه الخاصية متاحه فقط للأعضاء المسجلين"),
// actions: [
// cancelButton,
// continueButton,
// ],
// );
//
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return alert;
// },
// );
//
// return;
// }
// showDialog(
// context: context,
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
// builder: (BuildContext context) => DiscussionInputDialog(onCommentPress: (comment) {
// sendComment(comment);
// }),
// );
// },
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 24, right: 24),
// alignment: Alignment.centerRight,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(30),
// color: ColorConsts.gradientPink,
// gradient: LinearGradient(
// stops: [0.0, 0.5],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [ColorConsts.gradientPink, ColorConsts.gradientOrange],
// ),
// ),
// child: Text(
// "إضافة تعليق",
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5),
// ),
// ),
// ),
// ),
// ],
// );
// }
// }

@ -1,9 +1,7 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.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/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
@ -45,8 +43,7 @@ class _DetailFragmentState extends State<DetailFragment> {
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.eMPLOYEENUMBER ?? ""),
ItemDetailView(LocaleKeys.employeeName.tr(),
(AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""),
ItemDetailView(LocaleKeys.employeeName.tr(), (AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""),
ItemDetailView(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
ItemDetailView(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gRADENAME ?? ""),
ItemDetailView(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")),
@ -68,5 +65,4 @@ class _DetailFragmentState extends State<DetailFragment> {
}
return jobName;
}
}

@ -3,10 +3,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
extension WithContainer on Widget {
Widget get insideContainer => Container(
color: Colors.white,
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: this);
Widget get insideContainer => Container(color: Colors.white, padding: const EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this);
}
class DefaultButton extends StatelessWidget {
@ -23,15 +20,7 @@ class DefaultButton extends StatelessWidget {
final List<Color>? colors;
DefaultButton(this.text, this.onPress,
{this.color,
this.isTextExpanded = true,
this.svgIcon,
this.disabledColor,
this.count = 0,
this.textColor = Colors.white,
this.iconData,
this.fontSize,
this.colors});
{this.color, this.isTextExpanded = true, this.svgIcon, this.disabledColor, this.count = 0, this.textColor = Colors.white, this.iconData, this.fontSize, this.colors});
@override
Widget build(BuildContext context) {
@ -42,8 +31,7 @@ class DefaultButton extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
gradient: onPress == null
? const LinearGradient(
colors: [Color(0xffEAEAEA), Color(0xffEAEAEA)])
? const LinearGradient(colors: [Color(0xffEAEAEA), Color(0xffEAEAEA)])
: LinearGradient(
transform: GradientRotation(.83),
begin: Alignment.topRight,
@ -58,20 +46,14 @@ class DefaultButton extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (iconData != null) Icon(iconData, color: textColor),
if (svgIcon != null)
SvgPicture.asset(svgIcon ?? "", color: textColor),
if (svgIcon != null) SvgPicture.asset(svgIcon ?? "", color: textColor),
if (!isTextExpanded)
Padding(
padding: EdgeInsets.only(
left: (iconData ?? svgIcon) != null ? 6 : 0),
padding: EdgeInsets.only(left: (iconData ?? svgIcon) != null ? 6 : 0),
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: fontSize ?? 16,
fontWeight: FontWeight.w600,
color: textColor,
letterSpacing: -0.48),
style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
),
),
if (isTextExpanded)
@ -79,11 +61,7 @@ class DefaultButton extends StatelessWidget {
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: fontSize ?? 16,
fontWeight: FontWeight.w600,
color: textColor,
letterSpacing: -0.48),
style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
),
),
if (count > 0)
@ -94,17 +72,11 @@ class DefaultButton extends StatelessWidget {
padding: const EdgeInsets.only(left: 5, right: 5),
alignment: Alignment.center,
height: 16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
child: Text(
"$count",
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w700,
color: Color(0xffD02127),
letterSpacing: -0.6),
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w700, color: Color(0xffD02127), letterSpacing: -0.6),
),
),
)

@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
class SimpleButton extends StatelessWidget {
final String text;
final VoidCallback? onPress;
final Color textColor;
final Color? color;
final double? fontSize;
final List<Color>? colors;
SimpleButton(this.text, this.onPress, {this.color, this.textColor = Colors.white, this.fontSize, this.colors});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onPress,
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 12, right: 12, top: 4, bottom: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
gradient: onPress == null
? const LinearGradient(colors: [Color(0xffEAEAEA), Color(0xffEAEAEA)])
: LinearGradient(
transform: const GradientRotation(.83),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: colors ??
[
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
]),
),
child: Text(
text,
style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
),
),
);
}
}

@ -98,8 +98,8 @@ class DynamicTextFieldWidget extends StatelessWidget {
],
),
),
if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkTextColor),
if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkTextColor),
if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor),
if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor,size: 20),
],
),
),

@ -55,6 +55,7 @@ dependencies:
nfc_manager: ^3.1.1
uuid: ^3.0.6
image_picker: ^0.8.5+3
file_picker: ^4.6.1
# maps
google_maps_flutter: ^2.0.2
google_maps_utils: ^1.4.0+1

Loading…
Cancel
Save