EngineProvider class

Initializes NCEngine, manages connection state, and bridges global SDK events into ChatUI.

Mixed-in types

Constructors

EngineProvider({String currentUserId = '', NexconnServerTimeDeltaResolver? serverTimeDeltaResolver})

Properties

channelMessageUpsertedNotifier ValueNotifier<Message?>
Emits messages that should update channel list previews.
final
channelNoDisturbLevelSyncNotifier ValueNotifier<ChannelNoDisturbLevelSyncEvent?>
Emits channel notification-level sync events.
final
channelPinnedSyncNotifier ValueNotifier<ChannelPinnedSyncEvent?>
Emits channel pinned-state sync events.
final
channelRefreshNotifier ValueNotifier<int>
Increments when channel lists should refresh.
final
channelUnreadStatusSyncNotifier ValueNotifier<ChannelUnreadStatusSyncEvent?>
Emits channel unread-state sync events.
final
connectionStatus ConnectionStatus
Latest SDK connection status.
no setter
connectionStatusNotifier ValueNotifier<ConnectionStatus>
Emits the latest SDK connection status.
final
currentUserId String
Current connected user id.
no setter
deletedMessagesNotifier ValueNotifier<List<Message>?>
Emits deleted messages that open chat pages should remove.
final
enableLocalNotification bool
Whether local notifications are enabled.
getter/setter pair
failedMessageCount int
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAcceptingEngineEvents bool
no setter
receivedMessageNotifier ValueNotifier<Message?>
Emits newly received messages accepted by the current session.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverNow DateTime
Current server-adjusted DateTime.
no setter
serverNowMilliseconds int
Current server-adjusted timestamp in milliseconds.
no setter
serverTimeDelta int?
Server-to-local clock delta in milliseconds.
no setter
totalUnreadCount int
Total unread count tracked by ChatUI.
no setter
typingStatusNotifier ValueNotifier<TypingStatusChangedEvent?>
Emits typing status changes from the SDK.
final

Methods

addAsyncMessageReceivedListener(NexconnAsyncMessageReceivedListener listener) → void
Adds a listener for accepted received messages.
addFailedMessage(Message message) → void
Tracks a message whose send failed locally.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addLocalNotificationFilter(NexconnLocalNotificationFilter filter) → void
Adds a filter that can suppress local notifications.
clearFailedMessages() → void
Clears all locally tracked failed messages.
connect(ConnectParams params, {OperationHandler<String>? handler}) Future<int>
Connects NCEngine and starts accepting session events on success.
createChannelHandler({bool gateEngineEvents = false}) → ChannelHandler
createMessageHandler({bool gateEngineEvents = false}) MessageHandler
disconnect({bool disablePush = false}) Future<int>
Disconnects NCEngine and clears ChatUI session state.
dispose() → void
Discards any resources used by the object.
override
failedMessageForChannel(ChannelType channelType, String channelId, {String? subChannelId}) Message?
initialize(InitParams params) Future<void>
Initializes NCEngine and binds ChatUI event handlers.
isFailedMessage(Message message) bool
Returns whether message is tracked as failed locally.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChannelMessageUpserted(Message message) → void
Publishes a message that should refresh channel previews.
notifyChannelNeedsRefresh() → void
Requests channel lists to refresh.
notifyChannelNoDisturbLevelSync(ChannelNoDisturbLevelSyncEvent event) → void
Publishes channel notification-level sync events.
notifyChannelPinnedSync(ChannelPinnedSyncEvent event) → void
Publishes channel pinned-state sync events.
notifyChannelUnreadStatusSync(ChannelUnreadStatusSyncEvent event) → void
Publishes channel unread-state sync events.
notifyListeners() → void
Call all the registered listeners.
inherited
notifyMessageReceived(Message message, {bool refreshChannel = true, bool showNotification = true, bool throttleChannelRefresh = false}) → void
Publishes a received message to ChatUI listeners.
notifyMessagesDeleted(List<Message>? messages) → void
Publishes deleted-message events to open chat pages.
reduceTotalUnreadCount(int count) → void
Decreases the tracked total unread count by count.
refreshAppSettings() Future<void>
Refreshes app-wide settings such as server time delta.
refreshConnectionStatus() Future<void>
Refreshes connection status from NCEngine.
removeAsyncMessageReceivedListener(NexconnAsyncMessageReceivedListener listener) → void
Removes a received-message listener.
removeFailedMessage(Message message) → void
Removes a message from the local failed-message set.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeLocalNotificationFilter(NexconnLocalNotificationFilter filter) → void
Removes a local notification filter.
resetSessionStateForTesting() → void
setupLocalNotification({bool enable = true}) Future<void>
Initializes local notification support for received messages.
showLocalNotification(Message message, {String? title, String? body}) Future<void>
Shows a local notification for message when filters allow it.
toString() String
A string representation of this object.
inherited
updateCurrentUserId(String userId) → void
Updates the current user id when the host app manages connection itself.
updateEngineEventsAcceptedForTesting(bool value) → void
updateTotalUnreadCount(int count) → void
Replaces the tracked total unread count.

Operators

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