isDateChanged static method
Checks the current header id with previous header id @param position Position of the current item @return boolean True if header changed, else false
Implementation
static bool isDateChanged(int position, List<ChatMessageModel> mChatData) {
// try {
var prePosition = position + 1;
var size = mChatData.length - 1;
if (position == size) {
return true;
} else {
if (prePosition <= size && position <= size) {
var currentHeaderId = mChatData[position].messageSentTime.toInt();
var previousHeaderId = mChatData[prePosition].messageSentTime.toInt();
return currentHeaderId != previousHeaderId;
}
}
return false;
}