diff --git a/android/build.gradle b/android/build.gradle
index 12dceb5..21e1f2f 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/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 176eb48..2f8758c 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,5 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-#distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
\ No newline at end of file
diff --git a/assets/icons/close.svg b/assets/icons/close.svg
new file mode 100644
index 0000000..631fcfa
--- /dev/null
+++ b/assets/icons/close.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/chat-group.svg b/assets/images/chat-group.svg
new file mode 100644
index 0000000..127a793
--- /dev/null
+++ b/assets/images/chat-group.svg
@@ -0,0 +1,56 @@
+
+
+
\ No newline at end of file
diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json
index 48f443e..8ff0ea3 100644
--- a/assets/langs/ar-SA.json
+++ b/assets/langs/ar-SA.json
@@ -527,6 +527,8 @@
"noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam": "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض",
+ "group" : "مجموعة",
+ "searchGroup": "مجموعة البحث",
"connectHmgWifi": "قم بتوصيل HMG WIFI",
"connectedHmgWifi": "اتصال HMG WIFI",
"itgForms": "نماذج (ITG)",
@@ -537,5 +539,8 @@
"allDocuments": "كافة المستندات",
"expiredDocuments": "المستندات منتهية الصلاحية",
"missingDocuments": "مستندات مفقودة",
- "uploadedDocuments": "المستندات التي تم تحميلها"
+ "uploadedDocuments": "المستندات التي تم تحميلها",
+ "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.",
+ "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
+ "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني"
}
\ No newline at end of file
diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json
index b005710..2449802 100644
--- a/assets/langs/en-US.json
+++ b/assets/langs/en-US.json
@@ -527,6 +527,8 @@
"noWinner": "Sad! No one won today.",
"myTeam": "My Team",
"youCanPlayDemo": "But you can play demo",
+ "group": "Groups",
+ "searchGroup": "Search Group",
"connectHmgWifi": "Connect HMG WIFI",
"connectedHmgWifi": "Connected HMG WIFI",
"itgForms": "ITG Forms",
@@ -537,5 +539,27 @@
"allDocuments": "All\nDocuments",
"expiredDocuments": "Expired\nDocuments",
"missingDocuments": "Missing\nDocuments",
- "uploadedDocuments": "Uploaded\nDocuments"
+ "uploadedDocuments": "Uploaded\nDocuments",
+ "manage": "Manage",
+ "members": "Members",
+ "areYouSureWantTodelete": "Are you sure want to delete?",
+ "groupMembers": "Group Members",
+ "manageGroup": "Manage Group",
+ "admin": "Admin",
+ "addUsers": "Add users to the group",
+ "editGroups":"Edit Group",
+ "groupNameshouldbe": "Group name should be minimum 10 character long",
+ "enterGroupName": "Please enter valid group Name",
+ "groupName": "Group Name",
+ "enterGroupNamePlease": "Please enter group name",
+ "audioCall": "Audio Call",
+ "videoCall": "Video Call",
+ "shareScreen": "Share Screen",
+ "searchByUserName": "Search By Username",
+ "userSearch": "User Search",
+ "userName": "User Name",
+ "userId": "UserID",
+ "addAtLeastOneAttachment": "Please add at least one attachment.",
+ "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.",
+ "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit."
}
\ No newline at end of file
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 447afb8..f1f07ca 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -66,7 +66,6 @@
processing
fetch
remote-notification
- voip
UILaunchStoryboardName
LaunchScreen
diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart
index 8518cd7..3fbe57c 100644
--- a/lib/api/api_client.dart
+++ b/lib/api/api_client.dart
@@ -186,6 +186,13 @@ class ApiClient {
} else {
headers['Content-Type'] = 'application/json';
}
+
+ if (!kReleaseMode) {
+ print("Url:$url");
+ // var bodyJson = json.encode(jsonObject);
+ // print("body:$bodyJson");
+ }
+
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes);
}
diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart
index d127a3a..e9a5afa 100644
--- a/lib/api/chat/chat_api_client.dart
+++ b/lib/api/chat/chat_api_client.dart
@@ -12,7 +12,11 @@ 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/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';
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;
@@ -189,58 +193,121 @@ class ChatApiClient {
return imagesData;
}
- // CallUser Login Token
-
- Future getUserCallToken({required String userid}) async {
- user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel();
- Response response = await ApiClient().postJsonForResponse(
- "${ApiConsts.chatLoginTokenUrl}externaluserlogin",
- {
- "employeeNumber": userid,
- "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG",
- },
- );
+ //group chat apis start here.
+ Future getGroupsByUserId() async {
+ try {
+ Response response = await ApiClient().getJsonForResponse(
+ "${ApiConsts.getGroupByUserId}${AppState().chatDetails!.response!.id}",
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ return groups.GetUserGroups.fromRawJson(response.body);
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
+ }
+ }
- if (!kReleaseMode) {
- logger.i("login-res: " + response.body);
+ Future deleteGroup(int? groupId) async {
+ try {
+ Response response = await ApiClient().postJsonForResponse(
+ ApiConsts.deleteGroup,
+ {"groupId": groupId},
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ return response;
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
}
- if (response.statusCode == 200) {
- userLoginResponse = user.userAutoLoginModelFromJson(response.body);
- } else if (response.statusCode == 501 || response.statusCode == 502 || response.statusCode == 503 || response.statusCode == 504) {
- getUserCallToken(userid: userid);
- } else {
- userLoginResponse = user.userAutoLoginModelFromJson(response.body);
- Utils.showToast(userLoginResponse.errorResponses!.first.message!);
+ }
+
+ Future updateGroupAdmin(int? groupId, List groupList) async {
+ try {
+ Response response = await ApiClient().postJsonForResponse(
+ ApiConsts.updateGroupAdmin,
+ {"groupId": groupId, "groupUserList": groupList},
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ return response;
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
}
- return userLoginResponse;
}
- // Call Decline On App Terminated State
- Future callDecline({required int cUserID, required int tUserID, required String targetUsertoken}) async {
- Response response = await ApiClient().postJsonForResponse(
- "${ApiConsts.chatLoginTokenUrl}calldecline",
- {"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken},
- );
- print("res: " + response.body);
- if (!kReleaseMode) {
- logger.i({"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken});
- print("res: " + response.body);
+ Future> getGroupChatHistory(int? groupId, List groupList) async {
+ try {
+ Response response = await ApiClient().postJsonForResponse(
+ ApiConsts.getGroupChatHistoryAsync,
+ {"groupId": groupId, "targetUserList": groupList, "CurrentId": AppState().chatDetails!.response!.id},
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ List groupChat = [];
+ List groupChatData = json.decode(response.body);
+ for (var i in groupChatData) {
+ groupChat.add(GetGroupChatHistoryAsync.fromJson(i));
+ }
+
+ groupChat.sort((a, b) => b.createdDate!.compareTo(a.createdDate!));
+ return groupChat;
+ // for(GetGroupChatHistoryAsync i in groupChat) {
+ // return GetGroupChatHistoryAsync.fromJson(jsonEncode(i));
+ // }
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
}
- return response;
}
- Future oneSignalVoip(String value) async {
- String id = "";
- Response response = await ApiClient().postJsonForResponse(
- "${ApiConsts.oneSignalCall}players",
- {"app_id": ApiConsts.oneSignalAppID, "identifier": value, "device_type": 0, "test_type": !kReleaseMode ? 1 : 0},
- );
+ Future addGroupAndUsers(createGroup.CreateGroupRequest request) async {
+ try {
+ Response response = await ApiClient().postJsonForResponse(
+ ApiConsts.addGroupsAndUsers,
+ request,
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ return response.body;
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
+ }
+ }
- Map values = jsonDecode(response.body) as Map;
- id = values["id"];
- if (!kReleaseMode) {
- print("res: " + response.body);
+ Future updateGroupAndUsers(createGroup.CreateGroupRequest request) async {
+ try {
+ Response response = await ApiClient().postJsonForResponse(
+ ApiConsts.updateGroupsAndUsers,
+ request,
+ token: AppState().chatDetails!.response!.token,
+ );
+ if (!kReleaseMode) {
+ logger.i("res: " + response.body);
+ }
+ return response.body;
+ } catch (e) {
+ //if fail api returning 500 hence just printing here
+ print(e);
+ throw e;
}
- return id;
}
}
diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart
index 544ba71..77cc37d 100644
--- a/lib/api/dashboard_api_client.dart
+++ b/lib/api/dashboard_api_client.dart
@@ -201,7 +201,7 @@ class DashboardApiClient {
}, url, postParams);
}
- Future setAdvertisementViewed(String masterID, int advertisementId, String ackValue) async {
+ Future setAdvertisementViewed(String masterID, int advertisementId, String? ackValue) async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed";
Map postParams = {
diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart
index 030a949..342ac31 100644
--- a/lib/api/profile_api_client.dart
+++ b/lib/api/profile_api_client.dart
@@ -180,7 +180,7 @@ class ProfileApiClient {
],
"P_CONTACT_RELATIONSHIP_ID": contactRelationId,
"P_ACTION": actionType,
- "PayrollCodeStr": "CS",
+ "PayrollCodeStr": "HMG",
"LegislationCodeStr": "SA",
};
postParams.addAll(AppState().postParamsJson);
diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart
index 628701f..29805ec 100644
--- a/lib/api/worklist/worklist_api_client.dart
+++ b/lib/api/worklist/worklist_api_client.dart
@@ -348,12 +348,12 @@ class WorkListApiClient {
}, url, postParams);
}
- Future getITGFormDetails(String requestType, int taskId, int itemId, String employeeNumber) async {
+ Future getITGFormDetails(String requestType, taskId, itemId, String employeeNumber) async {
String url = "${ApiConsts.cocRest}ITGGetFormDetials";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
};
postParams.addAll(AppState().postParamsJson);
@@ -363,12 +363,12 @@ class WorkListApiClient {
}, url, postParams);
}
- Future rejectITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
+ Future rejectITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGRejectRequest";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@@ -379,12 +379,12 @@ class WorkListApiClient {
}, url, postParams);
}
- Future approveITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
+ Future approveITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGApproveRequest";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@@ -395,12 +395,12 @@ class WorkListApiClient {
}, url, postParams);
}
- Future delegateITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
+ Future delegateITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGDelegateRequest";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"NewUserEMPId": newUserEMPId,
"Comments": comments,
@@ -414,12 +414,12 @@ class WorkListApiClient {
// ANSWER = 'Services/COCWS.svc/REST/ITGAnswer';
- Future answerITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
+ Future answerITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGAnswer";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@@ -435,7 +435,7 @@ class WorkListApiClient {
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
@@ -448,12 +448,12 @@ class WorkListApiClient {
}, url, postParams);
}
- Future informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
+ Future informationITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map postParams = {
"RequestType": requestType,
"TaskID": taskId,
- "ItemID": itemId,
+ "ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"NewUserEMPId": newUserEMPId,
"Comments": comments,
diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart
index b7dfa34..d4276f4 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: 31, versionID: 4.8, mobileType: Platform.isAndroid ? "android" : "ios");
+ final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 5.3, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;
@@ -193,8 +193,8 @@ class AppState {
}
bool cancelRequestTrancsection = true;
-
-
+
+
String _iosVoipPlayerID = "";
String get iosVoipPlayerID => _iosVoipPlayerID;
@@ -202,7 +202,7 @@ class AppState {
set setiosVoipPlayerID(String value) {
_iosVoipPlayerID = value;
}
-
+
bool _isUserOnline = false;
bool get getisUserOnline => _isUserOnline;
diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart
index 318bb81..6c5d40e 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/";
@@ -20,6 +20,14 @@ class ApiConsts {
static String chatLoginTokenUrl = chatServerBaseApiUrl + "user/";
static String chatHubConnectionUrl = chatServerBaseUrl + "ConnectionChatHub";
+ //Groups
+ static String getGroupByUserId = chatServerBaseApiUrl + "group/getgroupsbyuserid/";
+ static String deleteGroup = chatServerBaseApiUrl + "group/updateGroupIsDeleted/";
+ static String updateGroupAdmin = chatServerBaseApiUrl + "group/updateGroupAdmin/";
+ static String getGroupChatHistoryAsync = chatServerBaseApiUrl + "GroupChat/GetGroupChatHistoryAsync/";
+ static String addGroupsAndUsers = chatServerBaseApiUrl + "group/addgroupandusers/";
+ static String updateGroupsAndUsers = chatServerBaseApiUrl + "group/updategroupandusers/";
+
// static String chatSearchMember = chatLoginTokenUrl + "user/";
static String chatRecentUrl = chatServerBaseApiUrl + "UserChatHistory/"; //For a Mem
static String chatSingleUserHistoryUrl = chatServerBaseApiUrl + "UserChatHistory/";
diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart
index 9c198b3..80f0d79 100644
--- a/lib/classes/notifications.dart
+++ b/lib/classes/notifications.dart
@@ -117,7 +117,10 @@ class AppNotifications {
debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken");
}
- void _onTokenError(Object error) {}
+ void _onTokenError(Object error) {
+ debugPrint("HUAWEI PUSH TOKEN ERROR: $error");
+ Utils.hideLoading(context);
+ }
Future initTokenStream(Function loginCallback) async {
huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) {
diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart
index 7885fad..9c55375 100644
--- a/lib/classes/utils.dart
+++ b/lib/classes/utils.dart
@@ -349,7 +349,7 @@ class Utils {
}
static Future selectDate(BuildContext context, DateTime selectedDate) async {
- if (Platform.isIOS) {
+ if (!Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (BuildContext cxt) => Container(
@@ -401,7 +401,6 @@ class Utils {
}
return false;
}
-
static bool isDate(String input, String format) {
try {
DateTime d = DateFormat(format).parseStrict(input);
diff --git a/lib/config/routes.dart b/lib/config/routes.dart
index 2a6ed46..6517deb 100644
--- a/lib/config/routes.dart
+++ b/lib/config/routes.dart
@@ -9,6 +9,9 @@ import 'package:mohem_flutter_app/ui/chat/call/chat_incoming_call_screen.dart';
import 'package:mohem_flutter_app/ui/chat/chat_detailed_screen.dart';
import 'package:mohem_flutter_app/ui/chat/chat_home.dart';
import 'package:mohem_flutter_app/ui/chat/favorite_users_screen.dart';
+import 'package:mohem_flutter_app/ui/chat/group_chat_detaied_screen.dart';
+import 'package:mohem_flutter_app/ui/chat/group_members.dart';
+import 'package:mohem_flutter_app/ui/chat/manage_group.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/ui/landing/itg/change_itg_ad_password_screen.dart';
import 'package:mohem_flutter_app/ui/landing/itg/its_add_screen_video_image.dart';
@@ -192,6 +195,10 @@ class AppRoutes {
static const String chatFavoriteUsers = "/chatFavoriteUsers";
static const String chatStartCall = "/chatStartCall";
+ //Group Chat
+ static const String manageGroup = "/manageGroup";
+ static const String groupMembers = "/groupmembers";
+ static const String groupChatDetailed = "/groupChatDetailed";
//Marathon
static const String marathonIntroScreen = "/marathonIntroScreen";
static const String marathonScreen = "/marathonScreen";
@@ -306,6 +313,11 @@ class AppRoutes {
chatStartCall: (BuildContext context) => StartCallPage(),
+ //Group Chat
+ manageGroup: (BuildContext context) => ManageGroupScreen(),
+ groupMembers: (BuildContext context) => GroupMembersScreen(),
+ groupChatDetailed: (BuildContext context) => GroupChatDetailScreen(),
+
// Marathon
marathonIntroScreen: (BuildContext context) => MarathonIntroScreen(),
marathonScreen: (BuildContext context) => MarathonScreen(),
diff --git a/lib/extensions/int_extensions.dart b/lib/extensions/int_extensions.dart
index 16bdd29..f46d5bb 100644
--- a/lib/extensions/int_extensions.dart
+++ b/lib/extensions/int_extensions.dart
@@ -10,6 +10,4 @@ extension IntExtensions on int {
Widget get divider => Divider(height: toDouble(), thickness: toDouble(), color: MyColors.lightGreyEFColor);
Widget get makeItSquare => SizedBox(width: toDouble(), height: toDouble());
-
-
}
diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart
index 45cfc05..3af55f0 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;
@@ -136,8 +162,9 @@ extension EmailValidator on String {
),
);
- Widget toText17({Color? color, bool isBold = false}) => Text(
+ Widget toText17({Color? color, bool isBold = false, bool isCentered = false}) => Text(
this,
+ textAlign: isCentered ? TextAlign.center : null,
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
@@ -170,6 +197,12 @@ 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/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart
index c8bfdfa..a433421 100644
--- a/lib/generated/codegen_loader.g.dart
+++ b/lib/generated/codegen_loader.g.dart
@@ -6,1095 +6,1108 @@ import 'dart:ui';
import 'package:easy_localization/easy_localization.dart' show AssetLoader;
-class CodegenLoader extends AssetLoader{
+class CodegenLoader extends AssetLoader {
const CodegenLoader();
@override
- Future