Chat Count Api / Chat Token Updates / Chat Call UI

merge-requests/57/head
Aamir Muhammad 3 years ago
parent 68939f6256
commit 00dee97bca

@ -7,6 +7,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:logger/logger.dart' as L; import 'package:logger/logger.dart' as L;
import 'package:logging/logging.dart';
import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
@ -27,6 +28,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<ChatUser>? pChatHistory, searchedChats; List<ChatUser>? pChatHistory, searchedChats;
late HubConnection hubConnection; late HubConnection hubConnection;
L.Logger logger = L.Logger(); L.Logger logger = L.Logger();
bool hubConInitialized = false;
bool isLoading = true; bool isLoading = true;
bool isChatScreenActive = false; bool isChatScreenActive = false;
@ -43,13 +45,27 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool _shouldAutoscroll = false; bool _shouldAutoscroll = false;
Future<void> getUserAutoLoginToken() async { Future<void> getUserAutoLoginToken() async {
String userName = AppState().memberInformationList!.eMPLOYEEEMAILADDRESS!.split("@").first.toString(); Response response = await ApiClient().postJsonForResponse(
//userName "${ApiConsts.chatServerBaseApiUrl}user/externaluserlogin",
Response response = {
await ApiClient().postJsonForResponse("${ApiConsts.chatServerBaseApiUrl}user/desktopuserlogin", {"userName": userName, "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG", "loginType": 2}); "employeeNumber": int.parse(
login.UserAutoLoginModel userLoginResponse = login.userAutoLoginModelFromJson(response.body); AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
AppState().setchatUserDetails = userLoginResponse; ),
await buildHubConnection(); "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG"
},
);
login.UserAutoLoginModel userLoginResponse = login.userAutoLoginModelFromJson(
response.body,
);
if (userLoginResponse.response != null) {
hubConInitialized = true;
AppState().setchatUserDetails = userLoginResponse;
await buildHubConnection();
} else {
Utils.showToast(userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr");
return;
}
} }
Future<List<ChatUser>?> getChatMemberFromSearch(String sName, int cUserId) async { Future<List<ChatUser>?> getChatMemberFromSearch(String sName, int cUserId) async {
@ -95,6 +111,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void getSingleUserChatHistory({required String senderUID, required int receiverUID, required bool loadMore, bool isNewChat = false}) async { void getSingleUserChatHistory({required String senderUID, required int receiverUID, required bool loadMore, bool isNewChat = false}) async {
isLoading = true; isLoading = true;
if (isNewChat) userChatHistory = [];
if (!loadMore) paginationVal = 0; if (!loadMore) paginationVal = 0;
isChatScreenActive = true; isChatScreenActive = true;
Response response = await ApiClient().getJsonForResponse( Response response = await ApiClient().getJsonForResponse(
@ -151,8 +168,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
hubConnection = HubConnectionBuilder() hubConnection = HubConnectionBuilder()
.withUrl(ApiConsts.chatHubConnectionUrl + "?UserId=${AppState().chatDetails!.response!.id}&source=Web&access_token=${AppState().chatDetails!.response!.token}", options: httpOp) .withUrl(ApiConsts.chatHubConnectionUrl + "?UserId=${AppState().chatDetails!.response!.id}&source=Web&access_token=${AppState().chatDetails!.response!.token}", options: httpOp)
.withAutomaticReconnect( .withAutomaticReconnect(
retryDelays: <int>[2000, 5000, 10000, 20000], retryDelays: <int>[2000, 5000, 10000, 20000],
).build(); )
.configureLogging(Logger("Loggin"))
.build();
hubConnection.onclose( hubConnection.onclose(
({Exception? error}) {}, ({Exception? error}) {},
); );
@ -173,6 +192,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow); hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
hubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered); hubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
hubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus); hubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
} }
} }
@ -215,9 +235,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void updateChatHistoryWindow(List<Object?>? args) { void updateChatHistoryWindow(List<Object?>? args) {
dynamic items = args!.toList(); dynamic items = args!.toList();
if (kDebugMode) { print("---------------------------------Update Chat History Windows Async -------------------------------------");
print("---------------------------------Update Chat History Windows Async -------------------------------------");
}
logger.d(items); logger.d(items);
// for (var user in searchedChats!) { // for (var user in searchedChats!) {
// if (user.id == items.first["id"]) { // if (user.id == items.first["id"]) {

@ -1,10 +1,12 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:http/http.dart';
import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/models/chat/chat_count_conversation_model.dart';
import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart';
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; 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/itg_forms_model.dart';
@ -15,7 +17,6 @@ import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
class DashboardApiClient { class DashboardApiClient {
static final DashboardApiClient _instance = DashboardApiClient._internal(); static final DashboardApiClient _instance = DashboardApiClient._internal();
@ -178,4 +179,11 @@ class DashboardApiClient {
return responseData; return responseData;
}, url, postParams); }, url, postParams);
} }
Future<ChatUnreadCovnCountModel> getChatCount() async {
Response response = await ApiClient().getJsonForResponse(
"${ApiConsts.chatServerBaseApiUrl}user/unreadconversationcount/${AppState().getUserName}",
);
return chatUnreadCovnCountModelFromJson(response.body);
}
} }

@ -1,7 +1,7 @@
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server //static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
//static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -0,0 +1,25 @@
import 'dart:convert';
ChatUnreadCovnCountModel chatUnreadCovnCountModelFromJson(String str) => ChatUnreadCovnCountModel.fromJson(json.decode(str));
String chatUnreadCovnCountModelToJson(ChatUnreadCovnCountModel data) => json.encode(data.toJson());
class ChatUnreadCovnCountModel {
ChatUnreadCovnCountModel({
this.singleChatCount,
this.groupChatCount,
});
int? singleChatCount;
int? groupChatCount;
factory ChatUnreadCovnCountModel.fromJson(Map<String, dynamic> json) => ChatUnreadCovnCountModel(
singleChatCount: json["singleChatCount"] == null ? null : json["singleChatCount"],
groupChatCount: json["groupChatCount"] == null ? null : json["groupChatCount"],
);
Map<String, dynamic> toJson() => {
"singleChatCount": singleChatCount == null ? null : singleChatCount,
"groupChatCount": groupChatCount == null ? null : groupChatCount,
};
}

@ -1,4 +1,3 @@
import 'dart:convert'; import 'dart:convert';
UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel.fromJson(json.decode(str)); UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel.fromJson(json.decode(str));
@ -7,22 +6,22 @@ String userAutoLoginModelToJson(UserAutoLoginModel data) => json.encode(data.toJ
class UserAutoLoginModel { class UserAutoLoginModel {
UserAutoLoginModel({ UserAutoLoginModel({
this.response, this.response,
this.errorResponses, this.errorResponses,
}); });
Response? response; Response? response;
dynamic? errorResponses; List<ErrorResponse>? errorResponses;
factory UserAutoLoginModel.fromJson(Map<String, dynamic> json) => UserAutoLoginModel( factory UserAutoLoginModel.fromJson(Map<String, dynamic> json) => UserAutoLoginModel(
response: json["response"] == null ? null : Response.fromJson(json["response"]), response: json["response"] == null ? null : Response.fromJson(json["response"]),
errorResponses: json["errorResponses"], errorResponses: json["errorResponses"] == null ? null : List<ErrorResponse>.from(json["errorResponses"].map((x) => ErrorResponse.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"response": response == null ? null : response!.toJson(), "response": response == null ? null : response!.toJson(),
"errorResponses": errorResponses, "errorResponses": errorResponses == null ? null : List<dynamic>.from(errorResponses!.map((x) => x.toJson())),
}; };
} }
class Response { class Response {
@ -51,28 +50,48 @@ class Response {
String? encryptedUserName; String? encryptedUserName;
factory Response.fromJson(Map<String, dynamic> json) => Response( factory Response.fromJson(Map<String, dynamic> json) => Response(
id: json["id"] == null ? null : json["id"], id: json["id"] == null ? null : json["id"],
userName: json["userName"] == null ? null : json["userName"], userName: json["userName"] == null ? null : json["userName"],
email: json["email"] == null ? null : json["email"], email: json["email"] == null ? null : json["email"],
phone: json["phone"] == null ? null : json["phone"], phone: json["phone"] == null ? null : json["phone"],
title: json["title"] == null ? null : json["title"], title: json["title"] == null ? null : json["title"],
token: json["token"] == null ? null : json["token"], token: json["token"] == null ? null : json["token"],
isDomainUser: json["isDomainUser"] == null ? null : json["isDomainUser"], isDomainUser: json["isDomainUser"] == null ? null : json["isDomainUser"],
isActiveCode: json["isActiveCode"] == null ? null : json["isActiveCode"], isActiveCode: json["isActiveCode"] == null ? null : json["isActiveCode"],
encryptedUserId: json["encryptedUserId"] == null ? null : json["encryptedUserId"], encryptedUserId: json["encryptedUserId"] == null ? null : json["encryptedUserId"],
encryptedUserName: json["encryptedUserName"] == null ? null : json["encryptedUserName"], encryptedUserName: json["encryptedUserName"] == null ? null : json["encryptedUserName"],
); );
Map<String, dynamic> toJson() => {
"id": id == null ? null : id,
"userName": userName == null ? null : userName,
"email": email == null ? null : email,
"phone": phone == null ? null : phone,
"title": title == null ? null : title,
"token": token == null ? null : token,
"isDomainUser": isDomainUser == null ? null : isDomainUser,
"isActiveCode": isActiveCode == null ? null : isActiveCode,
"encryptedUserId": encryptedUserId == null ? null : encryptedUserId,
"encryptedUserName": encryptedUserName == null ? null : encryptedUserName,
};
}
class ErrorResponse {
ErrorResponse({
this.fieldName,
this.message,
});
String? fieldName;
String? message;
factory ErrorResponse.fromJson(Map<String, dynamic> json) => ErrorResponse(
fieldName: json["fieldName"] == null ? null : json["fieldName"],
message: json["message"] == null ? null : json["message"],
);
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"id": id == null ? null : id, "fieldName": fieldName == null ? null : fieldName,
"userName": userName == null ? null : userName, "message": message == null ? null : message,
"email": email == null ? null : email, };
"phone": phone == null ? null : phone,
"title": title == null ? null : title,
"token": token == null ? null : token,
"isDomainUser": isDomainUser == null ? null : isDomainUser,
"isActiveCode": isActiveCode == null ? null : isActiveCode,
"encryptedUserId": encryptedUserId == null ? null : encryptedUserId,
"encryptedUserName": encryptedUserName == null ? null : encryptedUserName,
};
} }

@ -7,6 +7,7 @@ import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/chat/chat_count_conversation_model.dart';
import 'package:mohem_flutter_app/models/dashboard/drawer_menu_item_model.dart'; import 'package:mohem_flutter_app/models/dashboard/drawer_menu_item_model.dart';
import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart';
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
@ -34,6 +35,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool isWorkListLoading = true; bool isWorkListLoading = true;
int workListCounter = 0; int workListCounter = 0;
//Chat
bool isChatCounterLoding = true;
int chatUConvCounter = 0;
//Misssing Swipe //Misssing Swipe
bool isMissingSwipeLoading = true; bool isMissingSwipeLoading = true;
int missingSwipeCounter = 0; int missingSwipeCounter = 0;
@ -91,6 +96,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
accrualList = null; accrualList = null;
leaveBalanceAccrual = null; leaveBalanceAccrual = null;
isChatCounterLoding = true;
chatUConvCounter = 0;
ticketBalance = 0; ticketBalance = 0;
isServicesMenusLoading = true; isServicesMenusLoading = true;
homeMenus = null; homeMenus = null;
@ -266,7 +274,19 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return res; return res;
} }
void fetchChatCounts() async {
print("----------------------- Fetch Count ____________________________________");
try {
ChatUnreadCovnCountModel response = await DashboardApiClient().getChatCount();
chatUConvCounter = response.singleChatCount!;
isChatCounterLoding = false;
notifyListeners();
} catch (ex) {
logger.wtf(ex);
notifyListeners();
Utils.handleException(ex, null, null);
}
}
void notify() { void notify() {
notifyListeners(); notifyListeners();

@ -255,6 +255,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// backToHome(); // backToHome();
// final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity); // final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity);
await _controller?.dispose(); await _controller?.dispose();
// changeCallStatusAPI(4); // changeCallStatusAPI(4);
// if (_session != null && _signaling != null) { // if (_session != null && _signaling != null) {
@ -300,6 +301,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// final connected = await signaling.declineCall(widget.incomingCallData.callerID, widget.incomingCallData.receiverID); // final connected = await signaling.declineCall(widget.incomingCallData.callerID, widget.incomingCallData.receiverID);
// LandingPage.isOpenCallPage = false; // LandingPage.isOpenCallPage = false;
// _signaling // _signaling
_animationController!.dispose();
// player.stop(); // player.stop();
// changeCallStatusAPI(3); // changeCallStatusAPI(3);
// _signaling.bye(_session, callRejected: true); // _signaling.bye(_session, callRejected: true);

@ -34,15 +34,25 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
void getMoreChat() async { void getMoreChat() async {
if (userDetails != null) { if (userDetails != null) {
data.paginationVal = data.paginationVal + 10; data.paginationVal = data.paginationVal + 10;
data.getSingleUserChatHistory(senderUID: AppState().chatDetails!.response!.id.toString(), receiverUID: userDetails["targetUser"].id, loadMore: true, isNewChat: false); if (userDetails != null)
data.getSingleUserChatHistory(
senderUID: AppState().chatDetails!.response!.id.toString(),
receiverUID: userDetails["targetUser"].id,
loadMore: true,
isNewChat: false,
);
} }
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(
const Duration(
milliseconds: 1000,
),
);
_rc.loadComplete(); _rc.loadComplete();
} }
@override @override
void initState() { Widget build(BuildContext context) {
super.initState(); userDetails = ModalRoute.of(context)!.settings.arguments;
data = Provider.of<ChatProviderModel>(context, listen: false); data = Provider.of<ChatProviderModel>(context, listen: false);
if (userDetails != null) if (userDetails != null)
data.getSingleUserChatHistory( data.getSingleUserChatHistory(
@ -51,12 +61,6 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
loadMore: false, loadMore: false,
isNewChat: userDetails["isNewChat"], isNewChat: userDetails["isNewChat"],
); );
//data.scrollController.addListener(data.scrollListener);
}
@override
Widget build(BuildContext context) {
userDetails = ModalRoute.of(context)!.settings.arguments;
return Scaffold( return Scaffold(
backgroundColor: const Color(0xFFF8F8F8), backgroundColor: const Color(0xFFF8F8F8),
appBar: AppBarWidget(context, appBar: AppBarWidget(context,
@ -66,7 +70,7 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
actions: [ actions: [
IconButton( IconButton(
onPressed: () { onPressed: () {
makeCall("AUDIO"); // makeCall("AUDIO");
}, },
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/images/call.svg", "assets/images/call.svg",
@ -76,7 +80,7 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
makeCall("VIDEO"); // makeCall("VIDEO");
}, },
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/images/call.svg", "assets/images/call.svg",

@ -1,6 +1,9 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/chat/chat_provider_model.dart'; import 'package:mohem_flutter_app/api/chat/chat_provider_model.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -31,7 +34,7 @@ class _ChatHomeState extends State<ChatHome> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
data = Provider.of<ChatProviderModel>(context, listen: false); data = Provider.of<ChatProviderModel>(context, listen: false);
data.getUserAutoLoginToken().then((value) { data.getUserAutoLoginToken().then((Object? value) {
data.getUserRecentChats(); data.getUserRecentChats();
}); });
} }
@ -39,7 +42,9 @@ class _ChatHomeState extends State<ChatHome> {
@override @override
void dispose() { void dispose() {
data.clearAll(); data.clearAll();
data.hubConnection.stop(); if (data.hubConInitialized) {
data.hubConnection.stop();
}
super.dispose(); super.dispose();
} }

@ -71,6 +71,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries(); data.fetchMenuEntries();
data.getCategoryOffersListAPI(context); data.getCategoryOffersListAPI(context);
data.fetchChatCounts();
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
} }
@ -268,7 +269,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
).onPress(() { ).onPress(() {
showMyBottomSheet( showMyBottomSheet(
context, context,
callBackFunc: (){}, callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true), child: MarkAttendanceWidget(model, isFromDashboard: true),
); );
}), }),
@ -469,10 +470,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
label: LocaleKeys.itemsForSale.tr(), label: LocaleKeys.itemsForSale.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: Stack(
"assets/icons/chat/chat.svg", alignment: Alignment.centerLeft,
color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color, children: [
).paddingAll(4), SvgPicture.asset(
"assets/icons/chat/chat.svg",
color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.chatUConvCounter == 0) {
return const SizedBox();
}
return Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
),
label: LocaleKeys.chat.tr(), label: LocaleKeys.chat.tr(),
), ),
], ],

@ -236,7 +236,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
arguments: {"targetUser": chatUsersList![index], "isNewChat": true}, arguments: {"targetUser": chatUsersList![index], "isNewChat": true},
); );
}, },
onLongPress: () {},
), ),
); );
}, },

Loading…
Cancel
Save