diff --git a/android/build.gradle b/android/build.gradle index dc67123..5effa33 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,6 +28,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart index 05af905..d077026 100644 --- a/lib/api/chat/chat_api_client.dart +++ b/lib/api/chat/chat_api_client.dart @@ -12,17 +12,13 @@ import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/chat/chat_user_image_model.dart'; -import 'package:mohem_flutter_app/models/chat/create_group_request.dart' - as createGroup; +import 'package:mohem_flutter_app/models/chat/create_group_request.dart' as createGroup; import 'package:mohem_flutter_app/models/chat/get_group_chat_history.dart'; import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart'; -import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart' - as groups; +import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart' as groups; import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart'; -import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart' - as user; -import 'package:mohem_flutter_app/models/chat/make_user_favotire_unfavorite_chat_model.dart' - as fav; +import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart' as user; +import 'package:mohem_flutter_app/models/chat/make_user_favotire_unfavorite_chat_model.dart' as fav; class ChatApiClient { static final ChatApiClient _instance = ChatApiClient._internal(); @@ -36,13 +32,11 @@ class ChatApiClient { Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatLoginTokenUrl}externaluserlogin", { - "employeeNumber": - AppState().memberInformationList!.eMPLOYEENUMBER.toString(), + "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG", "isMobile": true, - "deviceToken": AppState().getIsHuawei - ? AppState().getHuaweiPushToken - : AppState().getDeviceToken, + "platform": Platform.isIOS ? "ios" : "android", + "deviceToken": AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken, "isHuaweiDevice": AppState().getIsHuawei, }, ); @@ -52,10 +46,7 @@ class ChatApiClient { } if (response.statusCode == 200) { userLoginResponse = user.userAutoLoginModelFromJson(response.body); - } else if (response.statusCode == 501 || - response.statusCode == 502 || - response.statusCode == 503 || - response.statusCode == 504) { + } else if (response.statusCode == 501 || response.statusCode == 502 || response.statusCode == 503 || response.statusCode == 504) { getUserLoginToken(); } else { userLoginResponse = user.userAutoLoginModelFromJson(response.body); @@ -64,16 +55,9 @@ class ChatApiClient { return userLoginResponse; } - Future getChatMemberFromSearch( - String searchParam, int cUserId, int pageNo) async { + Future getChatMemberFromSearch(String searchParam, int cUserId, int pageNo) async { ChatUserModel chatUserModel; - Response response = await ApiClient().postJsonForResponse( - "${ApiConsts.chatLoginTokenUrl}getUserWithStatusAndFavAsync", - { - "employeeNumber": cUserId, - "userName": searchParam, - "pageNumber": pageNo - }, + Response response = await ApiClient().postJsonForResponse("${ApiConsts.chatLoginTokenUrl}getUserWithStatusAndFavAsync", {"employeeNumber": cUserId, "userName": searchParam, "pageNumber": pageNo}, token: AppState().chatDetails!.response!.token); if (!kReleaseMode) { logger.i("res: " + response.body); @@ -113,12 +97,7 @@ class ChatApiClient { } //Get User Chat History - Future getSingleUserChatHistory( - {required int senderUID, - required int receiverUID, - required bool loadMore, - bool isNewChat = false, - required int paginationVal}) async { + Future getSingleUserChatHistory({required int senderUID, required int receiverUID, required bool loadMore, bool isNewChat = false, required int paginationVal}) async { try { Response response = await ApiClient().getJsonForResponse( "${ApiConsts.chatSingleUserHistoryUrl}GetUserChatHistory/$senderUID/$receiverUID/$paginationVal", @@ -129,33 +108,23 @@ class ChatApiClient { } return response; } catch (e) { - getSingleUserChatHistory( - senderUID: senderUID, - receiverUID: receiverUID, - loadMore: loadMore, - paginationVal: paginationVal); + getSingleUserChatHistory(senderUID: senderUID, receiverUID: receiverUID, loadMore: loadMore, paginationVal: paginationVal); throw e; } } //Favorite Users - Future favUser( - {required int userID, required int targetUserID}) async { - Response response = await ApiClient().postJsonForResponse( - "${ApiConsts.chatFavUser}addFavUser", - {"targetUserId": targetUserID, "userId": userID}, - token: AppState().chatDetails!.response!.token); + Future favUser({required int userID, required int targetUserID}) async { + Response response = await ApiClient().postJsonForResponse("${ApiConsts.chatFavUser}addFavUser", {"targetUserId": targetUserID, "userId": userID}, token: AppState().chatDetails!.response!.token); if (!kReleaseMode) { logger.i("res: " + response.body); } - fav.FavoriteChatUser favoriteChatUser = - fav.FavoriteChatUser.fromRawJson(response.body); + fav.FavoriteChatUser favoriteChatUser = fav.FavoriteChatUser.fromRawJson(response.body); return favoriteChatUser; } //UnFavorite Users - Future unFavUser( - {required int userID, required int targetUserID}) async { + Future unFavUser({required int userID, required int targetUserID}) async { try { Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatFavUser}deleteFavUser", @@ -165,8 +134,7 @@ class ChatApiClient { if (!kReleaseMode) { logger.i("res: " + response.body); } - fav.FavoriteChatUser favoriteChatUser = - fav.FavoriteChatUser.fromRawJson(response.body); + fav.FavoriteChatUser favoriteChatUser = fav.FavoriteChatUser.fromRawJson(response.body); return favoriteChatUser; } catch (e) { e as APIException; @@ -181,12 +149,10 @@ class ChatApiClient { print(AppState().chatDetails!.response!.token); } - dynamic request = MultipartRequest( - 'POST', Uri.parse('${ApiConsts.chatMediaImageUploadUrl}upload')); + dynamic request = MultipartRequest('POST', Uri.parse('${ApiConsts.chatMediaImageUploadUrl}upload')); request.fields.addAll({'userId': userId, 'fileSource': '1'}); request.files.add(await MultipartFile.fromPath('files', file.path)); - request.headers.addAll( - {'Authorization': 'Bearer ${AppState().chatDetails!.response!.token}'}); + request.headers.addAll({'Authorization': 'Bearer ${AppState().chatDetails!.response!.token}'}); StreamedResponse response = await request.send(); String data = await response.stream.bytesToString(); if (!kReleaseMode) { @@ -196,8 +162,7 @@ class ChatApiClient { } // Download File For Chat - Future downloadURL( - {required String fileName, required String fileTypeDescription}) async { + Future downloadURL({required String fileName, required String fileTypeDescription}) async { Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatMediaImageUploadUrl}download", {"fileType": fileTypeDescription, "fileName": fileName, "fileSource": 1}, @@ -208,8 +173,7 @@ class ChatApiClient { } //Get Chat Users & Favorite Images - Future> getUsersImages( - {required List encryptedEmails}) async { + Future> getUsersImages({required List encryptedEmails}) async { List imagesData = []; Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatUserImages}images", @@ -252,7 +216,7 @@ class ChatApiClient { try { Response response = await ApiClient().postJsonForResponse( ApiConsts.deleteGroup, - {"groupId":groupId}, + {"groupId": groupId}, token: AppState().chatDetails!.response!.token, ); if (!kReleaseMode) { @@ -266,8 +230,7 @@ class ChatApiClient { } } - Future updateGroupAdmin( - int? groupId, List groupList) async { + Future updateGroupAdmin(int? groupId, List groupList) async { try { Response response = await ApiClient().postJsonForResponse( ApiConsts.updateGroupAdmin, @@ -285,16 +248,11 @@ class ChatApiClient { } } - Future> getGroupChatHistory( - int? groupId, List groupList) async { + Future> getGroupChatHistory(int? groupId, List groupList) async { try { Response response = await ApiClient().postJsonForResponse( ApiConsts.getGroupChatHistoryAsync, - { - "groupId": groupId, - "targetUserList": groupList, - "CurrentId": AppState().chatDetails!.response!.id - }, + {"groupId": groupId, "targetUserList": groupList, "CurrentId": AppState().chatDetails!.response!.id}, token: AppState().chatDetails!.response!.token, ); if (!kReleaseMode) { diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 64047e5..c656c70 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,8 +3,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - static String baseUrl = "https://hmgwebservices.com"; // Live server + static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 45cfc05..9979573 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -22,6 +22,32 @@ extension TrimString on String { } } +extension DatePerse on String { + String parseMonth() { + Map monthAbbreviations = { + 'JAN': '01', + 'FEB': '02', + 'MAR': '03', + 'APR': '04', + 'MAY': '05', + 'JUN': '06', + 'JUL': '07', + 'AUG': '08', + 'SEP': '09', + 'OCT': '10', + 'NOV': '11', + 'DEC': '12', + }; + + var split = this.split('-'); + String first = split[0]; + String second = split[1].substring(0, 3); + String third = split[2]; + second = monthAbbreviations[second.toUpperCase()] ?? second; + return DateFormat('yyyy/MM/dd', "en_US").format(DateFormat("dd-MM-yyyy", "en_US").parse("$first-$second-$third")); + } +} + String displayLocalizedContent({required bool isPhoneLangArabic, required int selectedLanguage, required String englishContent, required String arabicContent}) { if (selectedLanguage == 1) { return englishContent; @@ -170,6 +196,13 @@ extension EmailValidator on String { style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + + Widget toText23({Color? color, bool isBold = false, bool isCentered = false}) => Text( + this, + textAlign: isCentered ? TextAlign.center : null, + style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 23, letterSpacing: -0.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + ); + Widget toText24({Color? color, bool isBold = false, bool isCentered = false}) => Text( this, textAlign: isCentered ? TextAlign.center : null, diff --git a/lib/ui/dialogs/id/business_card_dialog.dart b/lib/ui/dialogs/id/business_card_dialog.dart index 141abbd..ed9f260 100644 --- a/lib/ui/dialogs/id/business_card_dialog.dart +++ b/lib/ui/dialogs/id/business_card_dialog.dart @@ -1,68 +1,82 @@ +import 'package:easy_localization/easy_localization.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/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'; class BusinessCardDialog extends StatelessWidget { + const BusinessCardDialog({Key? key}) : super(key: key); + @override Widget build(BuildContext context) { return RotatedBox( quarterTurns: 1, child: AspectRatio( aspectRatio: 3.5 / 2, - child: Container( - // width: MediaQuery.of(context).size.height / 2, - color: Colors.white, - margin: EdgeInsets.all(21), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Image.asset( - "assets/images/logos/bn_cloud_soloution.jpg", - width: 80, - height: 80, - ), - 12.height, - (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText20(isBold: true), - ], - ), - ), - Image.memory( - Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""), - width: 100, - height: 100, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + "assets/images/logos/bn_cloud_soloution.jpg", + width: 94, + height: 91.15, + ).paddingOnly(top: 4), + ], ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - 1.height, - (AppState().memberInformationList!.getPositionName() ?? "").toText13(), - 12.height, - (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText13(), - 1.height, - (AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText13(), - 1.height, - (AppState().memberInformationList!.jOBNAME ?? "").toText13(), - ], - ), - ], - ), - ), + ), + Image.memory( + Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""), + width: 129, + height: 129, + ), + ], + ).paddingOnly(top: 26, left: 8.5), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText23(isBold: true).paddingOnly(top: 15), + (AppState().memberInformationList!.getPositionName() ?? "").toText17( + color: MyColors.grey57Color, + ), + 30.height, + // (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText13(), + Row( + children: [ + const Icon(Icons.email, size: 17.5, color: MyColors.grey3AColor).paddingOnly(right: 11.5), + ("${LocaleKeys.email.tr()}: ").toText18(color: MyColors.grey57Color), + (AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText18(), + ], + ), + Row( + children: [ + const Icon(Icons.call, size: 17.5, color: MyColors.grey3AColor).paddingOnly(right: 11.5), + ("${LocaleKeys.mobile.tr()}: ").toText18(color: MyColors.grey57Color), + (AppState().memberInformationList!.mobileNumberWithZipCode ?? "").toText18(), + ], + ), + // 1.height, + // (AppState().memberInformationList!.jOBNAME ?? "").toText13(), + ], + ), + ], + ).paddingOnly(right: 13, left: 32, bottom: 28), ), ); } diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index 7df697c..4721470 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -119,7 +119,7 @@ class _AppDrawerState extends State { }), 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())), + 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: performLogout), // menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,); ], diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index cc16fc5..7c19b58 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -207,7 +207,7 @@ class ServicesWidget extends StatelessWidget { } else if (menuEntry.menuName == "MBL_PERINFO_SS") { Navigator.of(context).pushNamed(AppRoutes.profile); return; - } else if (menuEntry.menuName!.substring(4, menuEntry.menuName!.length) == "MBL_EMPLOYEE_DOCUMENTS") { + } else if (menuEntry.menuName!.isNotEmpty && menuEntry.menuName!.substring(4, menuEntry.menuName!.length) == "MBL_EMPLOYEE_DOCUMENTS") { Navigator.pushNamed(context, AppRoutes.myDocuments); return; } diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 8ba9673..20da2c8 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -9,6 +9,7 @@ import 'package:mohem_flutter_app/app_state/app_state.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'; @@ -341,17 +342,23 @@ class _DynamicInputScreenState extends State { if (getEitDffStructureList![j].fORMATTYPE == "X") { idColName = Utils.reverseFormatDate(idColName!); - if(Utils.isDate(Utils.reverseFormatDate(Utils.formatDateNew(idColName!)), "yyyy-MM-dd")){ - - idColName = Utils.formatStandardDate(Utils.formatStandardDate(Utils.formatDateNew(idColName!))); - // idColName = DateFormat('yyyy/MM/dd HH:mm:ss').format(date); - }else if(Utils.isDate(Utils.reverseFormatDate(idColName!), "dd-MM-yyyy")){ - - - // // change date format on 31/05/2023 - DateTime date = DateFormat('dd-MM-yyyy',"en_US").parse(idColName!); - idColName = DateFormat('yyyy-MM-dd HH:mm:ss',"en_US").format(date); + if (Utils.isDate(Utils.reverseFormatDate(Utils.formatDateNew(idColName!)), "yyyy-MM-dd")) { + idColName = Utils.formatStandardDate(Utils.formatStandardDate(Utils.formatDateNew(idColName!))); + } else if (Utils.isDate(Utils.reverseFormatDate(idColName!), "dd-MM-yyyy")) { + DateTime date = DateFormat('dd-MM-yyyy').parse(idColName!); + idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date); + } + if (getEitDffStructureList![j].isDefaultTypeIsCDPS) { + // if (displayText.contains(" 00:00:00")) { + // displayText = displayText.replaceAll(" 00:00:00", ""); + // } + // if (displayText.contains("/")) { + // displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(displayText)); + // } + if (idColName.contains("-")) { + idColName = idColName.parseMonth(); + } } } } @@ -496,9 +503,20 @@ class _DynamicInputScreenState extends State { }, ).paddingOnly(bottom: 12); } else if (model.fORMATTYPE == "N") { + 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', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(displayText)); + } + } + return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), - model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + displayText, // model.eSERVICESDV?.pIDCOLUMNNAME ?? "", isReadOnly: model.rEADONLY == "Y", isInputTypeNum: true, onChange: (text) { @@ -545,14 +563,14 @@ class _DynamicInputScreenState extends State { pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s',"en_US").format(date)); + getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); } else { eservicesdv = ESERVICESDV( pIDCOLUMNNAME: dateString, pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s',"en_US").format(date)); + getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); } getEitDffStructureList![index].eSERVICESDV = eservicesdv; setState(() {}); @@ -606,14 +624,14 @@ class _DynamicInputScreenState extends State { pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s',"en_US").format(date)); + getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); } else { eservicesdv = ESERVICESDV( pIDCOLUMNNAME: dateString, pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s',"en_US").format(date)); + getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); } getEitDffStructureList![index].eSERVICESDV = eservicesdv; @@ -723,7 +741,7 @@ class _DynamicInputScreenState extends State { onTap: () async { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if (getEitDffStructureList![index].isDefaultTypeIsCDPS) { - selectedDate = DateFormat("yyyy/MM/dd","en_US").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); + selectedDate = DateFormat("yyyy/MM/dd").parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); } else { selectedDate = DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); } @@ -735,7 +753,7 @@ class _DynamicInputScreenState extends State { pIDCOLUMNNAME: dateString, pRETURNMSG: "null", pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, - pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s',"en_US").format(date)); + pVALUECOLUMNNAME: getEitDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); getEitDffStructureList![index].eSERVICESDV = eservicesdv; setState(() {}); if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { diff --git a/lib/widgets/dialogs/dialogs.dart b/lib/widgets/dialogs/dialogs.dart index 6765e38..a84b02a 100644 --- a/lib/widgets/dialogs/dialogs.dart +++ b/lib/widgets/dialogs/dialogs.dart @@ -1,11 +1,18 @@ import 'package:flutter/material.dart'; -void showMDialog(context, {Widget? child, Color? backgroundColor, bool isDismissable = true}) async { +void showMDialog(context, {Widget? child, Color? backgroundColor, bool isDismissable = true, bool isBusniessCard = false}) async { return showDialog( context: context, barrierDismissible: isDismissable, builder: (context) { return Dialog( + shape: isBusniessCard + ? const RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + ) + : null, backgroundColor: backgroundColor, child: child, );