diff --git a/assets/images/EID_ARABIC_3.svg b/assets/images/EID_ARABIC_3.svg new file mode 100644 index 0000000..483a836 --- /dev/null +++ b/assets/images/EID_ARABIC_3.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/EID_Englsih_04.svg b/assets/images/EID_Englsih_04.svg new file mode 100644 index 0000000..c2a75b5 --- /dev/null +++ b/assets/images/EID_Englsih_04.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/assets/images/asddasd.svg b/assets/images/asddasd.svg new file mode 100644 index 0000000..b91a675 --- /dev/null +++ b/assets/images/asddasd.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 91fd28a..7e346c8 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; import 'package:http/io_client.dart'; @@ -18,15 +19,11 @@ class APIError { dynamic errorCode; int? errorType; String? errorMessage; - int? errorStatusCode; + int? errorStatusCode; + APIError(this.errorCode, this.errorMessage, this.errorType, this.errorStatusCode); - Map toJson() => { - 'errorCode': errorCode, - 'errorMessage': errorMessage, - 'errorType': errorType, - 'ErrorStatusCode': errorStatusCode - }; + Map toJson() => {'errorCode': errorCode, 'errorMessage': errorMessage, 'errorType': errorType, 'ErrorStatusCode': errorStatusCode}; @override String toString() { @@ -48,22 +45,22 @@ APIException _throwAPIException(Response response) { APIError? apiError; if (response.body != null && response.body.isNotEmpty) { var jsonError = jsonDecode(response.body); - apiError = APIError(jsonError['ErrorCode'], jsonError['ErrorMessage'], jsonError['ErrorType'],jsonError['ErrorStatusCode']); + apiError = APIError(jsonError['ErrorCode'], jsonError['ErrorMessage'], jsonError['ErrorType'], jsonError['ErrorStatusCode']); } return APIException(APIException.BAD_REQUEST, error: apiError); case 401: - return APIException(APIException.UNAUTHORIZED); + return const APIException(APIException.UNAUTHORIZED); case 403: - return APIException(APIException.FORBIDDEN); + return const APIException(APIException.FORBIDDEN); case 404: - return APIException(APIException.NOT_FOUND); + return const APIException(APIException.NOT_FOUND); case 500: - return APIException(APIException.INTERNAL_SERVER_ERROR); + return const APIException(APIException.INTERNAL_SERVER_ERROR); case 444: var downloadUrl = response.headers["location"]; return APIException(APIException.UPGRADE_REQUIRED, arguments: downloadUrl); default: - return APIException(APIException.OTHER); + return const APIException(APIException.OTHER); } } @@ -74,8 +71,16 @@ class ApiClient { factory ApiClient() => _instance; - Future postJsonForObject(FactoryConstructor factoryConstructor, String url, T jsonObject, - {String? token, Map? queryParameters, Map? headers, int retryTimes = 0, bool isFormData = false}) async { + Future postJsonForObject( + FactoryConstructor factoryConstructor, + String url, + T jsonObject, { + String? token, + Map? queryParameters, + Map? headers, + int retryTimes = 0, + bool isFormData = false, + }) async { var _headers = {'Accept': 'application/json'}; if (headers != null && headers.isNotEmpty) { _headers.addAll(headers); @@ -121,8 +126,15 @@ class ApiClient { } } - Future postJsonForResponse(String url, T jsonObject, - {String? token, Map? queryParameters, Map? headers, int retryTimes = 0, bool isFormData = false}) async { + Future postJsonForResponse( + String url, + T jsonObject, { + String? token, + Map? queryParameters, + Map? headers, + int retryTimes = 0, + bool isFormData = false, + }) async { String? requestBody; late Map stringObj; if (jsonObject != null) { @@ -157,9 +169,9 @@ class ApiClient { var queryString = new Uri(queryParameters: queryParameters).query; url = url + '?' + queryString; } - var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 120)); + var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(const Duration(seconds: 120)); - if (response. statusCode >= 200 && response.statusCode < 300) { + if (response.statusCode >= 200 && response.statusCode < 300) { return response; } else { throw _throwAPIException(response); @@ -167,7 +179,7 @@ class ApiClient { } on SocketException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); @@ -175,7 +187,7 @@ class ApiClient { } on HttpException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); @@ -185,7 +197,7 @@ class ApiClient { } on ClientException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); @@ -224,7 +236,7 @@ class ApiClient { var queryString = new Uri(queryParameters: queryParameters).query; url = url + '?' + queryString; } - var response = await _get(Uri.parse(url), headers: _headers).timeout(Duration(seconds: 60)); + var response = await _get(Uri.parse(url), headers: _headers).timeout(const Duration(seconds: 60)); if (response.statusCode >= 200 && response.statusCode < 300) { return response; @@ -234,7 +246,7 @@ class ApiClient { } on SocketException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); @@ -242,7 +254,7 @@ class ApiClient { } on HttpException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); @@ -252,7 +264,7 @@ class ApiClient { } on ClientException catch (e) { if (retryTimes > 0) { print('will retry after 3 seconds...'); - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1); } else { throw APIException(APIException.OTHER, arguments: e); diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index 87025f2..df81621 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -15,6 +15,7 @@ import 'package:mohem_flutter_app/models/dashboard/get_accural_ticket_balance_mo import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; import 'package:mohem_flutter_app/models/dashboard/list_menu.dart'; +import 'package:mohem_flutter_app/models/eit_attachment_ticket_model.dart'; import 'package:mohem_flutter_app/models/dashboard/courses_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_employee_parking_details_model.dart'; @@ -22,6 +23,7 @@ import 'package:mohem_flutter_app/models/greetings/greeting_card_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_main_response.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/sso_auth_model.dart'; +// import 'package:platform_device_id/platform_device_id.dart'; import 'package:uuid/uuid.dart'; @@ -34,7 +36,7 @@ class DashboardApiClient { Future getAttendanceTracking() async { String url = "${ApiConsts.erpRest}GET_Attendance_Tracking"; - Map postParams = {}; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -48,7 +50,7 @@ class DashboardApiClient { Future getOpenNotifications() async { String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS"; - Map postParams = {}; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -62,7 +64,7 @@ class DashboardApiClient { Future getCOCNotifications() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks"; - Map postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -76,7 +78,7 @@ class DashboardApiClient { Future getItgFormsPendingTask() async { String url = "${ApiConsts.cocRest}ITGFormsPendingTasks"; - Map postParams = {}; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -90,13 +92,13 @@ class DashboardApiClient { Future> getAccrualBalances(String effectiveDate, {String? empID}) async { String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES"; - Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; + Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; postParams.addAll(AppState().postParamsJson); if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; return await ApiClient().postJsonForObject( (json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAccrualBalancesList ?? []; + return responseData.getAccrualBalancesList ?? []; }, url, postParams, @@ -105,13 +107,13 @@ class DashboardApiClient { Future> getTicketAccuralBalance(String effectiveDate, {String? empID}) async { String url = "${ApiConsts.erpRest}GET_TICKET_ACCRUAL_BALANCES"; - Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; + Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; postParams.addAll(AppState().postParamsJson); if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; return await ApiClient().postJsonForObject( (json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAccrualBalancesTicketList ?? []; + return responseData.getAccrualBalancesTicketList ?? []; }, url, postParams, @@ -120,7 +122,7 @@ class DashboardApiClient { Future getOpenMissingSwipes() async { String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES"; - Map postParams = {}; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -135,12 +137,12 @@ class DashboardApiClient { //Menus List Future> getListMenu() async { String url = "${ApiConsts.erpRest}GET_MENU"; - Map postParams = {}; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.listMenu ?? []; + return responseData.listMenu ?? []; }, url, postParams, @@ -150,7 +152,7 @@ class DashboardApiClient { //GET_MENU_ENTRIES Future getGetMenuEntries() async { String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES"; - Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -164,7 +166,7 @@ class DashboardApiClient { Future getEventActivity() async { String url = "${ApiConsts.erpRest}Get_EventActivity"; - Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -178,7 +180,7 @@ class DashboardApiClient { Future getTicketBookingRedirection() async { String url = "${ApiConsts.erpRest}GET_PORTAL_REDIRECTION"; - Map postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { @@ -192,7 +194,7 @@ class DashboardApiClient { Future getTicketBalance() async { String url = "${ApiConsts.erpRest}GET_TICKET_BALANCE"; - Map postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( @@ -209,7 +211,7 @@ class DashboardApiClient { String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm"; //https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm' // Map postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER}; - Map postParams = { + Map postParams = { "ClientId": clientID, // "ClientId": "a9f4d1a0596d4aea8f830992ec4bdac1", "PersonId": AppState().memberInformationList?.eMPLOYEENUMBER, @@ -228,20 +230,35 @@ class DashboardApiClient { ); } + Future getTicketEitPDFDownload({required String peiExtraInfoId}) async { + String url = "${ApiConsts.erpRest}GET_EIT_ATTACHMENTS"; + Map postParams = { + "P_PERSON_EXTRA_INFO_ID": peiExtraInfoId, + "PersonId": AppState().memberInformationList?.eMPLOYEENUMBER, + "Username": AppState().memberInformationList?.eMPLOYEENUMBER, + "Language": "US", + "SessionId": AppState().postParamsObject?.pSessionId, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject( + (json) { + GetEitAttachmentTicket responseData = GetEitAttachmentTicket.fromJson(json); + return responseData; + }, + url, + postParams, + ); + } + Future getBookingSSOFinalRedirection({required String token}) async { // token = // "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ"; - // // var request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG')); - var request = http.MultipartRequest('POST', Uri.parse('https://Paxes-release.techmaster.in/SSO/HMG')); // UAT - // var request = http.MultipartRequest('POST', Uri.parse('https://paxes.com/sso/hmg')); // Prod - request.fields.addAll({'JWTToken': token}); - - // request.headers.addAll(headers); - + http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://www.paxes.com/sso/hmg')); + // http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG')); + request.fields.addAll({'JWTToken': token}); http.StreamedResponse response = await request.send(); if (response.statusCode == 302) { - print("================== post =========="); - var res = await response.stream.bytesToString(); + String res = await response.stream.bytesToString(); return response.headers["location"]; } else { print(response.reasonPhrase); @@ -261,7 +278,7 @@ class DashboardApiClient { var _mobileDeviceIdentifierPlugin = MobileDeviceIdentifier(); Codec stringToBase64 = utf8.fuse(base64); String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC"; - var uuid = Uuid(); + Uuid uuid = Uuid(); String? deviceId = ""; // Generate a v4 (random) id if (Platform.isAndroid) { @@ -273,7 +290,7 @@ class DashboardApiClient { IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo; deviceId = iosInfo.identifierForVendor; } - Map postParams = { + Map postParams = { "UID": deviceId, //uuid.v4(), //Mobile Id // "UID": uuid.v4(), //Mobile Id "Latitude": lat, @@ -299,10 +316,10 @@ class DashboardApiClient { //Mark Fake Location Future markFakeLocation({String lat = "0", String? long = "0", required String sourceName}) async { String url = "${ApiConsts.swpRest}CreateIssueInfo"; - var uuid = Uuid(); + Uuid uuid = Uuid(); // Generate a v4 (random) id - Map postParams = { + Map postParams = { "UID": uuid.v4(), //Mobile Id "Latitude": lat, "Longitude": long, @@ -326,7 +343,7 @@ class DashboardApiClient { Future getITGPageNotification() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotification"; - Map postParams = { + Map postParams = { "EmployeeNumber": AppState().getUserName, "ItgEnableAt": "After Service Submission", //Mobile Id "ItgServiceName": "Login", @@ -348,7 +365,7 @@ class DashboardApiClient { Future submitItgForm({required String comment, required String masterId, required List> itgList, required int serviceId}) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_Survey_Response"; - Map postParams = { + Map postParams = { "EmployeeNumber": AppState().getUserName, "ItgComments": comment, "ItgNotificationMasterId": masterId, @@ -369,7 +386,7 @@ class DashboardApiClient { Future getAdvertisementDetail(String masterID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotificationDetails"; - Map postParams = { + Map postParams = { "EmployeeNumber": AppState().getUserName, "ItgNotificationMasterId": masterID, //Mobile Id }; @@ -387,7 +404,7 @@ class DashboardApiClient { Future setAdvertisementViewed(String masterID, int advertisementId, String? ackValue) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed"; - Map postParams = { + Map postParams = { "ItgNotificationMasterId": masterID, "EmployeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), "ItgAdvertisementId": advertisementId, @@ -435,7 +452,7 @@ class DashboardApiClient { //Fetch All Courses Status Future fetchAllCoursesStatus() async { - String url = "https://elearning.hmg.com/moodle_dev/api/Fetch_All_Courses_Status.php"; + String url = ApiConsts.eLearningBaseUrl +"Fetch_All_Courses_Status.php"; Map headers = { 'x-api-key': 'bLi@mbXJeXTHd/)h&LFh%25+%25(Nbnaq6hBg%7d%5dyQbthY%7bv6ew6-5UT\$NASwucn%7d,_PSJpuwNCCen2%7djj%7b00HR2T-%5b,k7W%7d-0yepK?%258', diff --git a/lib/api/eit_api_client.dart b/lib/api/eit_api_client.dart index d473aaf..67f155a 100644 --- a/lib/api/eit_api_client.dart +++ b/lib/api/eit_api_client.dart @@ -25,16 +25,23 @@ class EITApiClient { postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (json) { + // Check if GetEITTransactionList exists and is not empty + if (json['GetEITTransactionList'] == null || (json['GetEITTransactionList'] is List && json['GetEITTransactionList'].isEmpty)) { + return isCompleteList ? >[] : []; + } + if (isCompleteList) { List> responseData = []; json['GetEITTransactionList'].forEach((element) { var transactionList = GetEitTransactionsModel.fromJson(element).collectionTransaction; - if (transactionList != null) responseData.add(transactionList); + if (transactionList != null && transactionList.isNotEmpty) { + responseData.add(transactionList); + } }); return responseData; } else { List? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction; - return responseData; + return responseData ?? []; } }, url, diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 21bf583..a1001e6 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 9.6, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 9.7, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 88ebf73..c20cdbc 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -5,12 +5,18 @@ class ApiConsts { // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver - // static String baseUrl = "http://10.201.204.101:2024"; + // static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://mohemm.hmg.com"; // New Live server + static String ssoBaseUrl = "https://sso.hmg.com"; // New Live server // + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "http://10.20.200.111:1010/"; + // static String baseUrl = "https://mohemm.hmg.com"; // New Live server + //static String eLearningBaseUrl = "https://elearning.hmg.com/moodle_dev/api/"; // Elearning server UAT + static String eLearningBaseUrl = "https://elearning.hmg.com/moodle/api/"; // Elearning server live // static String baseUrl = "http://10.20.200.111:1010/"; @@ -27,8 +33,8 @@ class ApiConsts { static String user = baseUrlServices + "api/User/"; static String cocRest = baseUrlServices + "COCWS.svc/REST/"; - static String ssoAuthRedirection = "https://sso-uat.hmg.com/api/auth/connect"; // UAT - // static String ssoAuthRedirection = "https://sso.hmg.com/api/auth/connect"; // Prod + static String ssoAuthRedirection = ssoBaseUrl + "/api/auth/connect"; + //Chat static String chatServerBaseUrl = "https://apiderichat.hmg.com/"; @@ -56,6 +62,7 @@ class ApiConsts { static String marathonBaseUrlUAT = "https://marathoon.com/uatservice/api/"; static String marathonBaseUrl = marathonBaseUrlLive; + // static String marathonBaseUrl = marathonBaseUrlUAT; static String marathonBaseUrlServices = "https://marathoon.com/service/"; static String marathonParticipantLoginUrl = marathonBaseUrl + "auth/participantlogin"; @@ -87,5 +94,3 @@ class SharedPrefsConsts { static String mohemmWifiPassword = "mohemmWifiPassword"; static String editItemForSale = "editItemForSale"; } - - diff --git a/lib/models/eit/get_eit_transaction_model.dart b/lib/models/eit/get_eit_transaction_model.dart index dffe320..eec3d98 100644 --- a/lib/models/eit/get_eit_transaction_model.dart +++ b/lib/models/eit/get_eit_transaction_model.dart @@ -30,7 +30,7 @@ class CollectionTransaction { String? dISPLAYFLAG; int? fROMROWNUM; int? nOOFROWS; - dynamic? nUMBERVALUE; + dynamic nUMBERVALUE; int? rOWNUM; String? sEGMENTNAME; String? sEGMENTPROMPT; @@ -80,7 +80,7 @@ class CollectionTransaction { } Map toJson() { - Map data = new Map(); + Map data = Map(); data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; data['DATATYPE'] = this.dATATYPE; data['DATE_VALUE'] = this.dATEVALUE; diff --git a/lib/models/eit_attachment_ticket_model.dart b/lib/models/eit_attachment_ticket_model.dart new file mode 100644 index 0000000..fe88831 --- /dev/null +++ b/lib/models/eit_attachment_ticket_model.dart @@ -0,0 +1,97 @@ +import 'dart:convert'; + +class GetEitAttachmentTicket { + List? getEitAttachmentList; + + GetEitAttachmentTicket({ + this.getEitAttachmentList, + }); + + factory GetEitAttachmentTicket.fromRawJson(String str) => GetEitAttachmentTicket.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory GetEitAttachmentTicket.fromJson(Map json) => GetEitAttachmentTicket( + getEitAttachmentList: json["GetEITAttachmentList"] == null ? [] : List.from(json["GetEITAttachmentList"]!.map((x) => GetEitAttachmentList.fromJson(x))), + ); + + Map toJson() => { + "GetEITAttachmentList": getEitAttachmentList == null ? [] : List.from(getEitAttachmentList!.map((x) => x.toJson())), + }; +} + +class GetEitAttachmentList { + int? attachedDocumentId; + int? categoryId; + int? datatypeId; + int? documentId; + String? entityName; + String? fileContentType; + String? fileData; + int? fileId; + String? fileName; + String? pk1Value; + String? pk2Value; + String? pk3Value; + String? pk4Value; + String? pk5Value; + int? seqNum; + + GetEitAttachmentList({ + this.attachedDocumentId, + this.categoryId, + this.datatypeId, + this.documentId, + this.entityName, + this.fileContentType, + this.fileData, + this.fileId, + this.fileName, + this.pk1Value, + this.pk2Value, + this.pk3Value, + this.pk4Value, + this.pk5Value, + this.seqNum, + }); + + factory GetEitAttachmentList.fromRawJson(String str) => GetEitAttachmentList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory GetEitAttachmentList.fromJson(Map json) => GetEitAttachmentList( + attachedDocumentId: json["ATTACHED_DOCUMENT_ID"], + categoryId: json["CATEGORY_ID"], + datatypeId: json["DATATYPE_ID"], + documentId: json["DOCUMENT_ID"], + entityName: json["ENTITY_NAME"], + fileContentType: json["FILE_CONTENT_TYPE"], + fileData: json["FILE_DATA"], + fileId: json["FILE_ID"], + fileName: json["FILE_NAME"], + pk1Value: json["PK1_VALUE"], + pk2Value: json["PK2_VALUE"], + pk3Value: json["PK3_VALUE"], + pk4Value: json["PK4_VALUE"], + pk5Value: json["PK5_VALUE"], + seqNum: json["SEQ_NUM"], + ); + + Map toJson() => { + "ATTACHED_DOCUMENT_ID": attachedDocumentId, + "CATEGORY_ID": categoryId, + "DATATYPE_ID": datatypeId, + "DOCUMENT_ID": documentId, + "ENTITY_NAME": entityName, + "FILE_CONTENT_TYPE": fileContentType, + "FILE_DATA": fileData, + "FILE_ID": fileId, + "FILE_NAME": fileName, + "PK1_VALUE": pk1Value, + "PK2_VALUE": pk2Value, + "PK3_VALUE": pk3Value, + "PK4_VALUE": pk4Value, + "PK5_VALUE": pk5Value, + "SEQ_NUM": seqNum, + }; +} diff --git a/lib/models/get_day_hours_type_details_list_model.dart b/lib/models/get_day_hours_type_details_list_model.dart index e4eef25..0a0c8b0 100644 --- a/lib/models/get_day_hours_type_details_list_model.dart +++ b/lib/models/get_day_hours_type_details_list_model.dart @@ -22,6 +22,8 @@ class GetDayHoursTypeDetailsList { dynamic? fROMROWNUM; String? lATEINFLAG; String? lATEINHRS; + String? lEAVEDESCRIPTION; + String? lEAVETYPECODE; String? mISSINGSWIPEFLAG; String? nONSCHEDULEDFLAG; dynamic? nOOFROWS; @@ -66,6 +68,8 @@ class GetDayHoursTypeDetailsList { this.fROMROWNUM, this.lATEINFLAG, this.lATEINHRS, + this.lEAVEDESCRIPTION, + this.lEAVETYPECODE, this.mISSINGSWIPEFLAG, this.nONSCHEDULEDFLAG, this.nOOFROWS, @@ -110,6 +114,8 @@ class GetDayHoursTypeDetailsList { fROMROWNUM = json['FROM_ROW_NUM']; lATEINFLAG = json['LATE_IN_FLAG']; lATEINHRS = json['LATE_IN_HRS']; + lEAVEDESCRIPTION = json['LEAVE_DESCRIPTION']; + lEAVETYPECODE = json['LEAVE_TYPE_CODE']; mISSINGSWIPEFLAG = json['MISSING_SWIPE_FLAG']; nONSCHEDULEDFLAG = json['NON_SCHEDULED_FLAG']; nOOFROWS = json['NO_OF_ROWS']; @@ -156,6 +162,8 @@ class GetDayHoursTypeDetailsList { data['FROM_ROW_NUM'] = this.fROMROWNUM; data['LATE_IN_FLAG'] = this.lATEINFLAG; data['LATE_IN_HRS'] = this.lATEINHRS; + data['LEAVE_DESCRIPTION'] = this.lEAVEDESCRIPTION; + data['LEAVE_TYPE_CODE'] = this.lEAVETYPECODE; data['MISSING_SWIPE_FLAG'] = this.mISSINGSWIPEFLAG; data['NON_SCHEDULED_FLAG'] = this.nONSCHEDULEDFLAG; data['NO_OF_ROWS'] = this.nOOFROWS; diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 2b7a2bb..e0224c0 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -21,6 +21,7 @@ import 'package:mohem_flutter_app/models/dashboard/menus.dart'; import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart'; import 'package:mohem_flutter_app/models/dashboard/courses_response_model.dart'; import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/models/eit_attachment_ticket_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/greetings/greeting_card_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; @@ -349,6 +350,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { try { GenericResponseModel? genericResponseModel = await DashboardApiClient().getTicketBookingRedirection(); if (genericResponseModel?.portalDirectionData?.pRedirection!.toLowerCase() == "alma") { + // ticketBookingResponse = TicketBookingResult(true, "a9f4d1a0596d4aea8f830992ec4bdac1"); ticketBookingResponse = TicketBookingResult(true, genericResponseModel?.portalDirectionData?.clientID); return; } @@ -358,7 +360,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { isEventLoadingLoading = false; notifyListeners(); Utils.handleException(ex, null, null); - ticketBookingResponse = TicketBookingResult(false, null); // Ensure a return value in case of an exception + ticketBookingResponse = TicketBookingResult(false, null); } } @@ -406,6 +408,23 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } } + Future getTicketEitPDFDownload({String? peiExtraInfoId}) async { + try { + GetEitAttachmentTicket? res = await DashboardApiClient().getTicketEitPDFDownload(peiExtraInfoId: peiExtraInfoId!); + if (res?.getEitAttachmentList != null && res?.getEitAttachmentList!.length! != 0 && res!.getEitAttachmentList!.first.fileData != null) { + return res; + } else { + return null; + } + } catch (ex) { + logger.wtf(ex); + isEventLoadingLoading = false; + notifyListeners(); + Utils.handleException(ex, null, null); + return null; // Ensure a return value in case of an exception + } + } + List parseMenus(List getMenuEntriesList) { List menus = []; for (int i = 0; i < getMenuEntriesList.length; i++) { diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index cce9d3b..5fbd585 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -315,6 +315,26 @@ class _MonthlyAttendanceScreenState extends State { bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y'; bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y'; + // Get leave type code and corresponding color + String? leaveTypeCode = getDayHoursTypeDetailsList[index].lEAVETYPECODE; + Color? leaveTypeColor; + bool useGradient = false; + + // Determine color based on leave type code + if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) { + leaveTypeColor = leaveTypeColors[leaveTypeCode]; + } + + // If no leave type color found, use default colors based on attendance status + if (leaveTypeColor == null) { + if (isDayIsPresent) { + leaveTypeColor = leaveTypeColors['Present']; + useGradient = true; // Use gradient for present days without leave type + } else if (isDayIsAbsent) { + leaveTypeColor = leaveTypeColors['Absent']; + } + } + if (isDayIsOff) { return Container( margin: const EdgeInsets.all(4), @@ -331,12 +351,13 @@ class _MonthlyAttendanceScreenState extends State { return Container( margin: const EdgeInsets.all(4), decoration: BoxDecoration( - gradient: const LinearGradient( + gradient: useGradient && leaveTypeColor != null ? LinearGradient( transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], - ), + ) : null, + color: !useGradient && leaveTypeColor != null ? leaveTypeColor : null, shape: BoxShape.circle, boxShadow: [ BoxShadow( @@ -358,7 +379,7 @@ class _MonthlyAttendanceScreenState extends State { return Container( margin: const EdgeInsets.all(4), decoration: BoxDecoration( - color: MyColors.backgroundBlackColor, + color: leaveTypeColor ?? MyColors.backgroundBlackColor, shape: BoxShape.circle, boxShadow: [ BoxShadow( @@ -751,3 +772,24 @@ class Meeting { Color background; bool isAllDay; } +const Map leaveTypeColors = { + 'Present': Color(0xFF00ad62), + 'Absent': Color(0xFFcb3232), + 'HOLIDAY': Color(0xFFF26B0F), + 'BUS_TRIP': Color(0xFF001A6E), + 'WFH': Color(0xFF5DB996), + 'ANNUAL': Color(0xFFf39c12), + 'EMERGENCY': Color(0xFFFF2929), + 'EXAM': Color(0xFFCB6040), + 'HAJJ': Color(0xFF798645), + 'HALF': Color(0xFFE8B86D), + 'LWOP': Color(0xFFCD5C08), + 'LWOP_MATUNPAID': Color(0xFFE73879), + 'LWOP_UNAUUNPAID': Color(0xFFA02334), + 'MATPAID': Color(0xFFE73879), + 'MRGE': Color(0xFF0D7C66), + 'PAT': Color(0xFFC96868), + 'PROF': Color(0xFF6256CA), + 'SICK': Color(0xFFA5B68D), +}; + diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 793712c..ea0d8d2 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -155,8 +155,8 @@ class _DashboardScreenState extends State with WidgetsBindingOb data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchMenuEntries(); data.fetchEventActivity(); - data.fetchGreetingCards(); data.getCategoryOffersListAPI(context); + data.fetchGreetingCards(); marathonProvider.getMarathonDetailsFromApi(); marathonProvider.getMarathonTutorial(); if (isFromInit) { @@ -431,32 +431,22 @@ class _DashboardScreenState extends State with WidgetsBindingOb return const GreetingCardShimmer(); } else if (model.isDisplayEidGreetings && model.greetingCardsList != null && model.greetingCardsList!.isNotEmpty) { return SizedBox( - height: 140, - child: ListView.separated( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - padding: const EdgeInsets.symmetric(horizontal: 24), - itemCount: model.greetingCardsList!.length, - separatorBuilder: (context, index) => const SizedBox(width: 24), - itemBuilder: (context, index) { - var card = model.greetingCardsList![index]; - return SvgPicture.network( - AppState().isArabic(context) - ? (card.backgroundImageUrlAr ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg") - : (card.backgroundImageUrlEn ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg"), - fit: BoxFit.fill, - placeholderBuilder: (context) => ClipRRect(borderRadius: BorderRadius.circular(18), child: Container(height: 80, color: Colors.white).toShimmer()), - ).onPress(() { - launchUrl(Uri.parse(AppState().isArabic(context) ? card.urlAr! : card.urlEn!)); - }); - }, - ), - ).paddingOnly(bottom: 0); + width: double.infinity, + child: SvgPicture.network( + AppState().isArabic(context) + ? (model.greetingCardsList!.first.backgroundImageUrlAr ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg") + : (model.greetingCardsList!.first.backgroundImageUrlEn ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg"), + fit: BoxFit.cover, + placeholderBuilder: (context) => ClipRRect(borderRadius: BorderRadius.circular(18), child: Container(height: 80, color: Colors.white).toShimmer()), + ).onPress(() { + launchUrl(Uri.parse(AppState().isArabic(context) ? model.greetingCardsList!.first.urlAr! : model.greetingCardsList!.first.urlEn!)); + }), + ); } else { return const SizedBox(); } }, - ).paddingOnly(bottom: 24), + ).paddingOnly(bottom: 24, left: 24, right: 24), // eventActivityWidget(context), if (isDisplayMazaya) ...[ Column( diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index e18518b..44843be 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -49,32 +49,18 @@ class _AppDrawerState extends State { children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 24), - const Icon(Icons.clear).onPress(() => Navigator.pop(context)), - ], + children: [Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 24), const Icon(Icons.clear).onPress(() => Navigator.pop(context))], ).paddingOnly(left: 4, right: 14), Row( children: [ AppState().memberInformationList!.eMPLOYEEIMAGE == null - ? SvgPicture.asset( - "assets/images/user.svg", - height: 52, - width: 52, - ) - : CircleAvatar( - radius: 52 / 2, - backgroundImage: MemoryImage(Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE!)), - backgroundColor: Colors.black, - ), + ? SvgPicture.asset("assets/images/user.svg", height: 52, width: 52) + : CircleAvatar(radius: 52 / 2, backgroundImage: MemoryImage(Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE!)), backgroundColor: Colors.black), 12.width, Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppState().memberInformationList!.eMPLOYEENAME!.toText18(isBold: true), - AppState().memberInformationList!.getPositionName().toText14(weight: FontWeight.w500), - ], - ).expanded + children: [AppState().memberInformationList!.eMPLOYEENAME!.toText18(isBold: true), AppState().memberInformationList!.getPositionName().toText14(weight: FontWeight.w500)], + ).expanded, ], ).paddingOnly(left: 14, right: 14, top: 21, bottom: 21), // Row( @@ -99,67 +85,77 @@ class _AppDrawerState extends State { // ), // ], // ).paddingOnly(left: 14, right: 14, bottom: 14), - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), + const Divider(height: 1, thickness: 1, color: MyColors.lightGreyEFColor), ListView( padding: const EdgeInsets.only(top: 21, bottom: 21), children: [ ListView.builder( - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: drawerMenuItemList.length, - itemBuilder: (cxt, index) { - return menuItem(drawerMenuItemList[index].icon, drawerMenuItemList[index].title, drawerMenuItemList[index].routeName, onPress: () { + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: drawerMenuItemList.length, + itemBuilder: (cxt, index) { + return menuItem( + drawerMenuItemList[index].icon, + drawerMenuItemList[index].title, + drawerMenuItemList[index].routeName, + onPress: () { Navigator.pushNamed(context, drawerMenuItemList[index].routeName); - }); - }), + }, + ); + }, + ), menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())), if (AppState().businessCardPrivilege) - menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog(), isBusniessCard: true)), - menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: (){Utils.performLogout(context, chatData);}), + menuItem( + "assets/images/drawer/view_business_card.svg", + LocaleKeys.viewBusinessCard.tr(), + "", + closeDrawer: false, + onPress: () => showMDialog(context, child: BusinessCardDialog(), isBusniessCard: true), + ), + menuItem( + "assets/images/drawer/logout.svg", + LocaleKeys.logout.tr(), + "", + color: MyColors.redA3Color, + closeDrawer: false, + onPress: () async { + await Utils.performLogout(context, chatData); + }, + ), // menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,); ], ).expanded, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), + const Divider(height: 1, thickness: 1, color: MyColors.lightGreyEFColor), Row( children: [ RichText( - text: TextSpan(text: LocaleKeys.poweredBy.tr() + " ", style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), children: [ - TextSpan( - text: LocaleKeys.cloudSolutions.tr(), - style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), - ), - ]), + text: TextSpan( + text: LocaleKeys.poweredBy.tr() + " ", + style: const TextStyle(color: MyColors.grey98Color, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600), + children: [TextSpan(text: LocaleKeys.cloudSolutions.tr(), style: const TextStyle(color: MyColors.grey3AColor, fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600))], + ), ).expanded, - Image.asset("assets/images/logos/bn_cloud_soloution.jpg", width: 40, height: 40) + Image.asset("assets/images/logos/bn_cloud_soloution.jpg", width: 40, height: 40), ], - ).paddingOnly(left: 21, right: 21, top: 21) + ).paddingOnly(left: 21, right: 21, top: 21), ], ).paddingOnly(top: 21, bottom: 21), ); } Widget menuItem(String icon, String title, String routeName, {Color? color, bool closeDrawer = true, VoidCallback? onPress}) { - return Row( - children: [ - SvgPicture.asset(icon, height: 20, width: 20), - 9.width, - title.toText14(color: color, textAlign: AppState().isArabic(context) ? TextAlign.right : null).expanded, - ], - ).paddingOnly(left: 21, top: 10, bottom: 10, right: 21).onPress(closeDrawer - ? () async { - Navigator.pop(context); - Future.delayed(const Duration(microseconds: 200), onPress); - } - : onPress!); + return Row(children: [SvgPicture.asset(icon, height: 20, width: 20), 9.width, title.toText14(color: color, textAlign: AppState().isArabic(context) ? TextAlign.right : null).expanded]) + .paddingOnly(left: 21, top: 10, bottom: 10, right: 21) + .onPress( + closeDrawer + ? () async { + Navigator.pop(context); + Future.delayed(const Duration(microseconds: 200), onPress); + } + : onPress!, + ); } void postLanguageChange(BuildContext context) { @@ -171,13 +167,13 @@ class _AppDrawerState extends State { setState(() {}); } - // void performLogout() async { - // // AppState().isAuthenticated = false; - // // AppState().isLogged = false; - // // AppState().setPostParamsInitConfig(); - // // chatData.disposeData(); - // // // SharedPreferences prefs = await SharedPreferences.getInstance(); - // // // await prefs.clear(); - // // Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route route) => false, arguments: null); - // } + void performLogout() async { + AppState().isAuthenticated = false; + AppState().isLogged = false; + AppState().setPostParamsInitConfig(); + chatData.disposeData(); + // SharedPreferences prefs = await SharedPreferences.getInstance(); + // await prefs.clear(); + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route route) => false, arguments: null); + } } diff --git a/lib/ui/landing/widget/menus_widget.dart b/lib/ui/landing/widget/menus_widget.dart index e764dca..6abfb35 100644 --- a/lib/ui/landing/widget/menus_widget.dart +++ b/lib/ui/landing/widget/menus_widget.dart @@ -8,6 +8,7 @@ import 'package:mohem_flutter_app/config/routes.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/eit/get_eit_transaction_model.dart'; import 'package:mohem_flutter_app/models/sso_auth_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; diff --git a/lib/ui/screens/mowadhafhi/mowadhafhi_hr_request.dart b/lib/ui/screens/mowadhafhi/mowadhafhi_hr_request.dart index e7d2fde..b358843 100644 --- a/lib/ui/screens/mowadhafhi/mowadhafhi_hr_request.dart +++ b/lib/ui/screens/mowadhafhi/mowadhafhi_hr_request.dart @@ -192,10 +192,78 @@ class _MowadhafhiHRRequestState extends State { title.toText16().expanded, 6.width, SimpleButton(LocaleKeys.add.tr(), () async { - FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true); + FilePickerResult? result = await FilePicker.platform.pickFiles( + allowMultiple: true, + ); if (result != null) { - attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList(); - attachmentFiles = attachmentFiles.toSet().toList(); + // Maximum file size: 2 MB (in bytes) + const int maxFileSizeInBytes = 2 * 1024 * 1024; // 2 MB = 2097152 bytes + List newFiles = []; + List oversizedFiles = []; + + for (PlatformFile platformFile in result.files) { + if (platformFile.path != null) { + File file = File(platformFile.path!); + + // Get file size - check multiple sources for iOS compatibility + int fileSize = 0; + + // Method 1: Check platformFile.size first + if (platformFile.size > 0) { + fileSize = platformFile.size; + debugPrint('Using platformFile.size: $fileSize bytes'); + } + + // Method 2: Always verify with file.length() as well + try { + int fileLengthSize = await file.length(); + debugPrint('Using file.length(): $fileLengthSize bytes'); + // Use the maximum of both to ensure we catch the real size + if (fileLengthSize > fileSize) { + fileSize = fileLengthSize; + debugPrint('Using larger value from file.length()'); + } + } catch (e) { + debugPrint('Error getting file.length(): $e'); + // If file.length() fails, rely on platformFile.size + if (fileSize == 0) { + debugPrint('Cannot determine file size, rejecting file: ${platformFile.name}'); + oversizedFiles.add('${platformFile.name} (unknown size)'); + continue; + } + } + + double fileSizeMB = fileSize / (1024 * 1024); + debugPrint('Final file size - ${platformFile.name}: $fileSize bytes (${fileSizeMB.toStringAsFixed(2)} MB)'); + + // STRICT validation: Only accept files that are 2 MB or less + if (fileSize > 0 && fileSize <= maxFileSizeInBytes) { + debugPrint('✓ File accepted: ${platformFile.name}'); + newFiles.add(file); + } else if (fileSize > maxFileSizeInBytes) { + debugPrint('✗ File REJECTED (too large): ${platformFile.name} - ${fileSizeMB.toStringAsFixed(2)} MB'); + oversizedFiles.add('${platformFile.name} (${fileSizeMB.toStringAsFixed(2)} MB)'); + } else { + debugPrint('✗ File REJECTED (invalid size): ${platformFile.name}'); + oversizedFiles.add('${platformFile.name} (invalid)'); + } + } + } + + // Only add valid files + if (newFiles.isNotEmpty) { + attachmentFiles = attachmentFiles + newFiles; + attachmentFiles = attachmentFiles.toSet().toList(); + debugPrint('Total files attached: ${attachmentFiles.length}'); + } + + // Show error message for rejected files + if (oversizedFiles.isNotEmpty) { + String fileList = oversizedFiles.join('\n'); + Utils.showToast('Max 2MB File allowed.'); + debugPrint('Total rejected files: ${oversizedFiles.length}'); + } + setState(() {}); } }, fontSize: 14), diff --git a/lib/ui/screens/ticket/ticket_detailed_screen.dart b/lib/ui/screens/ticket/ticket_detailed_screen.dart index c4d232f..7959f39 100644 --- a/lib/ui/screens/ticket/ticket_detailed_screen.dart +++ b/lib/ui/screens/ticket/ticket_detailed_screen.dart @@ -5,15 +5,17 @@ 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/classes/date_uitl.dart'; +import 'package:mohem_flutter_app/classes/file_process.dart'; import 'package:mohem_flutter_app/classes/utils.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/dashboard/get_accural_ticket_balance_model.dart'; +import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/models/eit_attachment_ticket_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -import 'package:mohem_flutter_app/widgets/balances_dashboard_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart'; @@ -113,9 +115,8 @@ class _TicketDetailedScreenState extends State { ), ), const SizedBox(height: 21), - dashboardProviderModel == null && dashboardProviderModel!.ticketHistoryTransactionList == null - ? const SizedBox() - : ListView( + (dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty) + ? ListView( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), children: [ @@ -126,8 +127,8 @@ class _TicketDetailedScreenState extends State { shrinkWrap: true, padding: EdgeInsets.zero, itemBuilder: (BuildContext cxt, int cardIndex) { - var transactionDetails = dashboardProviderModel!.ticketHistoryTransactionList![cardIndex]; - const allowedSegmentNames = { + List transactionDetails = dashboardProviderModel!.ticketHistoryTransactionList![cardIndex]; + const Set allowedSegmentNames = { "TICKETS_ROUTE", "TRAVELER_NAME", "TICKETS_EFFECTIVE_DATE", @@ -136,11 +137,22 @@ class _TicketDetailedScreenState extends State { "TICKET_COMP_SHARE", "TICKET_EMP_SHARE", }; - var uniqueDetails = + // Get items for display + List uniqueDetails = transactionDetails - .where((item) => item.dISPLAYFLAG != 'N' && item.sEGMENTPROMPT != null && item.sEGMENTPROMPT!.isNotEmpty && allowedSegmentNames.contains(item.sEGMENTNAME)) + .where( + (CollectionTransaction item) => + item.dISPLAYFLAG != 'N' && item.sEGMENTPROMPT != null && item.sEGMENTPROMPT!.isNotEmpty && allowedSegmentNames.contains(item.sEGMENTNAME), + ) .toList(); + // Get PEI_EXTRA_INFO_ID value for View PDF + CollectionTransaction? peiExtraInfoItem = transactionDetails.firstWhere( + (CollectionTransaction item) => item.aPPLICATIONCOLUMNNAME == "PEI_EXTRA_INFO_ID", + orElse: () => CollectionTransaction(), + ); + num? peiExtraInfoId = peiExtraInfoItem.nUMBERVALUE; + return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, @@ -149,15 +161,15 @@ class _TicketDetailedScreenState extends State { physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: (uniqueDetails.length / 2).ceil(), - itemBuilder: (context, rowIndex) { + itemBuilder: (BuildContext context, int rowIndex) { int firstIndex = rowIndex * 2; int? secondIndex = (firstIndex + 1 < uniqueDetails.length) ? firstIndex + 1 : null; bool isLastRow = (rowIndex == (uniqueDetails.length / 2).ceil() - 1); - var item1 = uniqueDetails[firstIndex]; - var child1 = ItemDetailViewCol(item1.sEGMENTPROMPT!, item1.vARCHAR2VALUE ?? item1.nUMBERVALUE?.toString() ?? ""); + CollectionTransaction item1 = uniqueDetails[firstIndex]; + ItemDetailViewCol child1 = ItemDetailViewCol(item1.sEGMENTPROMPT!, item1.vARCHAR2VALUE ?? item1.nUMBERVALUE?.toString() ?? ""); Widget child2; if (secondIndex != null) { - var item2 = uniqueDetails[secondIndex]; + CollectionTransaction item2 = uniqueDetails[secondIndex]; child2 = ItemDetailViewCol(item2.sEGMENTPROMPT!, item2.vARCHAR2VALUE ?? item2.nUMBERVALUE?.toString() ?? ""); } else { child2 = const SizedBox(); // Empty widget if there is no second item @@ -165,6 +177,40 @@ class _TicketDetailedScreenState extends State { return ItemDetailGrid(child1, child2, isItLast: isLastRow); }, ), + // View PDF link at the bottom + if (peiExtraInfoId != null) ...[ + const SizedBox(height: 5), + Align( + alignment: Alignment.centerRight, + child: GestureDetector( + onTap: () async { + Utils.showLoading(context); + try { + GetEitAttachmentTicket? result = await dashboardProviderModel!.getTicketEitPDFDownload(peiExtraInfoId: peiExtraInfoId.toString()); + if (result != null && result.getEitAttachmentList != null && result.getEitAttachmentList!.isNotEmpty) { + String? base64Data = result.getEitAttachmentList!.first.fileData; + if (base64Data != null && base64Data.isNotEmpty) { + String fileName = result.getEitAttachmentList!.first.fileName!; + await FileProcess.downloadFile(base64Data, fileName); + Utils.hideLoading(context); + FileProcess.openFile(fileName); + } else { + Utils.hideLoading(context); + Utils.showToast("PDF data not available"); + } + } else { + Utils.hideLoading(context); + Utils.showToast("No attachment found"); + } + } catch (e) { + Utils.hideLoading(context); + Utils.showToast("Something Went Wrong"); + } + }, + child: Padding(padding: const EdgeInsets.only(top: 8.0, left: 0.0, bottom: 8.0), child: "View PDF".toText14(isUnderLine: true, isBold: true)), + ), + ), + ], ], ).objectContainerView(); }, @@ -172,7 +218,8 @@ class _TicketDetailedScreenState extends State { itemCount: dashboardProviderModel!.ticketHistoryTransactionList!.length, ), ], - ), + ) + : const SizedBox(), ], ], ).expanded, diff --git a/lib/widgets/shimmer/dashboard_shimmer_widget.dart b/lib/widgets/shimmer/dashboard_shimmer_widget.dart index 7d59899..05b30fa 100644 --- a/lib/widgets/shimmer/dashboard_shimmer_widget.dart +++ b/lib/widgets/shimmer/dashboard_shimmer_widget.dart @@ -19,13 +19,7 @@ class GetAttendanceTrackingShimmer extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Stack( alignment: Alignment.center, @@ -46,15 +40,8 @@ class GetAttendanceTrackingShimmer extends StatelessWidget { LocaleKeys.timeLeftToday.tr().toText10(color: Colors.white).toShimmer(), 9.height, const ClipRRect( - borderRadius: BorderRadius.all( - Radius.circular(20), - ), - child: LinearProgressIndicator( - value: 0.7, - minHeight: 8, - valueColor: const AlwaysStoppedAnimation(Colors.white), - backgroundColor: const Color(0xff196D73), - ), + borderRadius: BorderRadius.all(Radius.circular(20)), + child: LinearProgressIndicator(value: 0.7, minHeight: 8, valueColor: const AlwaysStoppedAnimation(Colors.white), backgroundColor: const Color(0xff196D73)), ).toShimmer(), ], ).paddingOnly(top: 12, right: 15, left: 12), @@ -65,9 +52,7 @@ class GetAttendanceTrackingShimmer extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.checkIn.tr().toText12(color: Colors.white).toShimmer(), - ], + children: [LocaleKeys.checkIn.tr().toText12(color: Colors.white).toShimmer()], ).paddingOnly(left: 12), ), Container( @@ -96,13 +81,7 @@ class MenuShimmer extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -111,14 +90,11 @@ class MenuShimmer extends StatelessWidget { LocaleKeys.workList.tr().toText12(color: Colors.white).toShimmer(), Row( children: [ - Expanded( - flex: 3, - child: 123.toString().toText10(color: Colors.white, isBold: true).toShimmer(), - ), + Expanded(flex: 3, child: 123.toString().toText10(color: Colors.white, isBold: true).toShimmer()), 12.width, - SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white).toShimmer() + SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white).toShimmer(), ], - ) + ), ], ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ); @@ -137,11 +113,7 @@ class ServicesHeaderShimmer extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.otherCharges.tr().toText10().toShimmer(), - 6.height, - LocaleKeys.services.tr().toText12(isBold: true).toShimmer(), - ], + children: [LocaleKeys.otherCharges.tr().toText10().toShimmer(), 6.height, LocaleKeys.services.tr().toText12(isBold: true).toShimmer()], ), ), LocaleKeys.viewAllServices.tr().toText12(isUnderLine: true).toShimmer(), @@ -159,13 +131,7 @@ class ServicesMenuShimmer extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -181,15 +147,13 @@ class ServicesMenuShimmer extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Expanded( - child: LocaleKeys.attendance.tr().toText11(isBold: false).toShimmer(), - ), + Expanded(child: LocaleKeys.attendance.tr().toText11(isBold: false).toShimmer()), 6.width, - SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4).toShimmer() + SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4).toShimmer(), ], ), ], - ) + ), ], ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), ); @@ -202,69 +166,35 @@ class GreetingCardShimmer extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 100, - decoration: BoxDecoration( - color: const Color(0xFFFAF4E7), - border: Border.all(width: 2, color: const Color(0xFFE7E7E7)), - borderRadius: BorderRadius.circular(20), - ), + height: 140, + decoration: BoxDecoration(color: const Color(0xFFFAF4E7), border: Border.all(width: 2, color: const Color(0xFFE7E7E7)), borderRadius: BorderRadius.circular(20)), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 65, - height: 81, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ).toShimmer(), + const SizedBox(width: 10), + Container(width: 65, height: 100, decoration: BoxDecoration(color: Colors.grey[300], borderRadius: BorderRadius.circular(10))).toShimmer().paddingOnly(top: 10), const SizedBox(width: 10), Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - width: 150, - height: 16, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - ).toShimmer(), + Container(width: 150, height: 16, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))).toShimmer(), const SizedBox(height: 8), - Container( - width: 120, - height: 16, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - ).toShimmer(), + Container(width: 120, height: 16, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))).toShimmer(), ], ).expanded, Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - width: 60, - height: 12, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - ).toShimmer(), - ], + children: [Container(width: 60, height: 12, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))).toShimmer()], ), ], ).paddingOnly(left: 8, right: 8, top: 6, bottom: 12), - ).paddingOnly(left: 21, right: 21, top: 14, bottom: 14); + ).paddingOnly(top: 14, bottom: 14); } } - class MarathonBannerShimmer extends StatelessWidget { const MarathonBannerShimmer({Key? key}) : super(key: key); @@ -274,13 +204,7 @@ class MarathonBannerShimmer extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -296,15 +220,13 @@ class MarathonBannerShimmer extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Expanded( - child: LocaleKeys.attendance.tr().toText11(isBold: false).toShimmer(), - ), + Expanded(child: LocaleKeys.attendance.tr().toText11(isBold: false).toShimmer()), 6.width, - SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4).toShimmer() + SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4).toShimmer(), ], ), ], - ) + ), ], ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), ); @@ -320,66 +242,43 @@ class ChatHomeShimmer extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: double.infinity, - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Shimmer.fromColors( - baseColor: Colors.white, - highlightColor: Colors.grey.shade100, - child: ListView.builder( - itemBuilder: (_, __) => Padding( - padding: const EdgeInsets.only(bottom: 8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (!isDetailedScreen) - Container( - width: 48.0, - height: 48.0, - decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(40))), - ), - if (!isDetailedScreen) - const Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - height: 20.0, - color: Colors.white, - ), - const Padding( - padding: EdgeInsets.symmetric(vertical: 2.0), - ), - Container( - width: double.infinity, - height: 15.0, - color: Colors.white, - ), - const Padding( - padding: EdgeInsets.symmetric(vertical: 2.0), - ), - Container( - width: 40.0, - height: 10.0, - color: Colors.white, - ), - ], - ).expanded - ], + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Shimmer.fromColors( + baseColor: Colors.white, + highlightColor: Colors.grey.shade100, + child: ListView.builder( + itemBuilder: + (_, __) => Padding( + padding: const EdgeInsets.only(bottom: 8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (!isDetailedScreen) Container(width: 48.0, height: 48.0, decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(40)))), + if (!isDetailedScreen) const Padding(padding: EdgeInsets.symmetric(horizontal: 8.0)), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container(width: double.infinity, height: 20.0, color: Colors.white), + const Padding(padding: EdgeInsets.symmetric(vertical: 2.0)), + Container(width: double.infinity, height: 15.0, color: Colors.white), + const Padding(padding: EdgeInsets.symmetric(vertical: 2.0)), + Container(width: 40.0, height: 10.0, color: Colors.white), + ], + ).expanded, + ], + ), ), - ), - itemCount: 6, - ), + itemCount: 6, ), ), - ], - )); + ), + ], + ), + ); } } - diff --git a/lib/widgets/sso_webview_widget.dart b/lib/widgets/sso_webview_widget.dart index ee4ed7a..f584c2c 100644 --- a/lib/widgets/sso_webview_widget.dart +++ b/lib/widgets/sso_webview_widget.dart @@ -49,7 +49,7 @@ class _SsoLoginWebViewState extends State { -
+

Redirecting...

@@ -57,6 +57,7 @@ class _SsoLoginWebViewState extends State { '''); } + ////
@override Widget build(BuildContext context) { return Scaffold(appBar: null, body:SafeArea(child: WebViewWidget(controller: _controller)));