compareContactListForUpdatedStateForOneContact method
void
compareContactListForUpdatedStateForOneContact(
- AtContact c
assigns isBlocking
, isMarkingFav
and isDeleting
for contact c
.
Implementation
void compareContactListForUpdatedStateForOneContact(AtContact c) {
var index =
baseContactList.indexWhere((e) => e.contact!.atSign == c.atSign);
if (index > -1) {
baseContactList[index] = BaseContact(
c,
isBlocking: baseContactList[index].isBlocking,
isMarkingFav: baseContactList[index].isMarkingFav,
isDeleting: baseContactList[index].isDeleting,
);
} else {
baseContactList.add(
BaseContact(
c,
isBlocking: false,
isMarkingFav: false,
isDeleting: false,
),
);
}
}