SubscriptionsModel<T extends SubscriptionModel> class
Subscriptions list model ((contains list of subscriptions, methods for managing them, handlers of library event)
- Inheritance
-
- Object
- ChangeNotifier
- SubscriptionsModel
Constructors
-
SubscriptionsModel.new(IAccountsModel _accountsModel, T _itemCreateFunc(Map<
String, dynamic> ), [ILogsModel? _logs])
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 subscriptions is empty
no setter
- length → int
-
Returns number of subscriptions in list
no setter
- onSaveChanges ↔ SaveChangesCallback?
-
Callback which model invokes when subscriptions 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
-
addSubscription(
T sub, {bool saveChanges = true}) → Future< void> - Add new subscription
-
deleteSubscription(
int index) → Future< void> - Delete subscription by index (sends SUBSCRIBE request with expire=0)
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
loadFromJson(
String subscrJsonStr) → 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
-
onSubscrStateChanged(
int subscrId, SubscriptionState s, String resp) → void - Handle library event raised when received NOTIFY request
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
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) → T - Returns subscription by its index in list