ContactService class

A service to handle CRUD operation on contacts

Constructors

ContactService()
Factory pattern to get singleton instance
factory

Properties

allContactsList List<String>
List of all contacts added by atsign
getter/setter pair
atClientManager ↔ AtClientManager
Instance of AtClientManager
getter/setter pair
atContactImpl ↔ AtContactsImpl
Instance of at_contact dart library
getter/setter pair
baseBlockedList List<BaseContact>
used by desktop contact screen to manage contacts and the operations performed on them.
getter/setter pair
baseContactList List<BaseContact>
used by desktop contact screen to manage contacts and the operations performed on them.
getter/setter pair
blockContactList List<AtContact>
List of contacts added by atsign
getter/setter pair
blockedContactSink Sink
Sink for the blocked contacts' list stream
no setter
blockedContactStream Stream<List<BaseContact?>>
Stream of blocked contacts' list
no setter
blockedContactStreamController StreamController<List<BaseContact?>>
Stream controller for blocked contacts' list stream
getter/setter pair
cachedContactList List<AtContact>
List of contacts added by atsign
getter/setter pair
checkAtSign bool?
Boolean indicator for validating atsign
getter/setter pair
contactList List<AtContact>
List of contacts added by atsign
getter/setter pair
contactSink Sink
Sink for the contacts' list stream
no setter
contactStream Stream<List<BaseContact?>>
Stream of contacts' list
no setter
contactStreamController StreamController<List<BaseContact?>>
Stream controller for contacts' list stream
getter/setter pair
currentAtsign String
Current atsign in use
getter/setter pair
getAtSignError String
Error thrown in fetching an atsign
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isContactPresent bool
Boolean flag to indicate a contact's presence
getter/setter pair
limitReached bool
Boolean flag to indicate a contact's presence
getter/setter pair
loggedInUserDetails ↔ AtContact?
Current atsign's contact details
getter/setter pair
rootDomain String
Root domain to access
getter/setter pair
rootPort int
Root port to access
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedContacts List<AtContact>
List of contacts added by atsign
getter/setter pair
selectedContactSink Sink
Sink for the selected contacts' list stream
no setter
selectedContactStream Stream<List<AtContact?>>
Stream of selected contacts' list
no setter
selectedContactStreamController StreamController<List<AtContact?>>
Stream controller for selected contacts' list stream
getter/setter pair

Methods

addAtSign({String? atSign, String? nickName}) Future<bool>
Function to validate, fetch details and save to current atsign's contact list
blockUnblockContact({required AtContact contact, required bool blockAction}) Future<bool>
blocks/unblocks contact based on boolean blockAction if blockAction is true , atContact will be blocked.
checkAtsign(String? atSign) Future<bool>
Function to validate atsign
clearAtSigns() → void
compareAtSign(String atsign1, String atsign2) bool
returns true if atsign1 & atsign2 are same
compareBlockedContactListForUpdatedState() → void
compares blockContactList with baseBlockedList and assigns isBlocking, isMarkingFav and isDeleting for existing atsigns in baseBlockedList.
compareContactListForUpdatedState() → void
compares contactList with baseContactList and assigns isBlocking, isMarkingFav and isDeleting for existing atsigns in baseContactList.
compareContactListForUpdatedStateForOneContact(AtContact c) → void
assigns isBlocking, isMarkingFav and isDeleting for contact c.
deleteAtSign({required String atSign}) Future<bool>
disposeControllers() → void
dispose function for all the stream controllers declared
fetchBlockContactList() Future<List<AtContact>?>
fetchContacts() Future<List<AtContact>?>
gives list of AtContact. returns null if some error occurred.
fetchProfilePictureMetaData(String atsign) Future<Metadata?>
getContactDetails(String? atSign, String? nickName) Future<Map<String, dynamic>>
Function to get firstname, lastname and profile picture of an atsign
getProfilePicture(String atsign) Future<Map<String, dynamic>?>
initContactsService(String rootDomainFromApp, int rootPortFromApp, {bool fetchContacts = true}) Future<void>
markFavContact(AtContact contact) Future<bool>
add/remove contact from faviorite list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeSelectedAtSign(AtContact? contact) → void
resetData() → void
selectAtSign(AtContact? contact) → void
toString() String
A string representation of this object.
inherited
updateState(STATE_UPDATE stateToUpdate, AtContact contact, bool state) → void
updates status of contacts for baseContactList and baseBlockedList

Operators

operator ==(Object other) bool
The equality operator.
inherited