MessagesModel class

Subscriptions list model (contains list of subscriptions, methods for managing them, handlers of library event)

Inheritance

Constructors

MessagesModel(IAccountsModel _accountsModel, [ILogsModel? _logs, int maxItems = 25])

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isEmpty → bool
Returns true when list of messages is empty
no setter
length → int
Returns number of messages in list
no setter
maxItems → int
final
onSaveChanges ↔ SaveChangesCallback?
Callback which model invokes when messages changes should be saved
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
loadFromJson(String jsonStr) → bool
Load list of subscriptions from json string (app should invoke it after loading accounts)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onMessageIncoming(int messageId, int accId, String from, String body) → void
Handle library event raised when received new message from remote side
onMessageSentState(int messageId, bool success, String resp) → void
Handle library event raised when received confirmation on sent message
remove(int index) → Future<void>
Delete message by index
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
send(MessageDestination msgDest, {bool saveChanges = true}) → Future<void>
Send message
storeToJson() → String
Store list of subscriptions to json string
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](int i) → MessageModel
Returns subscription by its index in list