getCallIconByStatus static method
String
getCallIconByStatus(
- BuildContext context,
- BaseMessage baseMessage,
- User? loggedInUser,
- bool isAudio,
Implementation
static String getCallIconByStatus(
BuildContext context, BaseMessage baseMessage, User? loggedInUser, bool isAudio) {
String callIcon = "";
//check if the message is a call message and the receiver type is user
if (baseMessage is Call) {
Call call = baseMessage;
User initiator = call.callInitiator as User;
//check if the call is initiated
if (call.callStatus == CallStatusConstants.initiated) {
//check if the logged in user is the initiator
if (!isLoggedInUser(initiator, loggedInUser)) {
callIcon = isAudio? AssetConstants.incomingAudioCallNoFill : AssetConstants.incomingVideoCallNoFill;
} else {
callIcon = isAudio? AssetConstants.outgoingAudioCallNoFill : AssetConstants.outgoingVideoCallNoFill;
}
}else if(!isLoggedInUser(initiator, loggedInUser) && ( call.callStatus == CallStatusConstants.cancelled || call.callStatus == CallStatusConstants.unanswered || call.callStatus == CallStatusConstants.busy)){
callIcon = isAudio? AssetConstants.audioMissed : AssetConstants.videoMissed;
} else {
callIcon = isAudio? AssetConstants.callNoFill : AssetConstants.videocamNoFill;
}
}
return callIcon;
}