Skip to main content

Architecture

Nexconn Chat UI SDK for Flutter is a thin UI layer on top of ai_nexconn_chat_plugin. It provides ready-made pages, providers, configuration objects, and callback hooks while keeping core messaging semantics in the underlying Nexconn Chat SDK.

Layers

LayerResponsibility
Nexconn Chat SDKConnection, channels, messages, friends, groups, and SDK models such as BaseChannel, Message, and NCEngine.
ProvidersUI state and orchestration for engine, channel list, chat, input, friend, group, profile, audio, and theme.
Pages and widgetsDefault Flutter screens for channel list, chat, input, message bubbles, previews, forwarding, profiles, friends, and groups.
ConfigurationChannelConfig, ChatPageConfig, MessageInputConfig, BubbleConfig, and related configuration objects.
Your Flutter appUser identity, token delivery, business profile data, custom routing, permissions, and feature-specific callbacks.

Provider model

NexconnChatUIProviders installs the app-level providers shared by the Chat UI package:

  • EngineProvider: initialization, connection state, incoming message events, channel refresh events, local notifications, total unread count, and global feature flags.
  • NexconnThemeProvider: light, dark, and custom theme tokens.

Feature pages create or accept their own scoped providers:

  • ChannelProvider: channel list loading, pagination, sorting hooks, pin, mute, delete, unread aggregation, and direct-channel online status.
  • ChatProvider: message loading, sending, deletion, delete-for-everyone, forwarding, references, search, unread handling, media helpers, and read-receipt helpers.
  • MessageInputProvider: input mode, draft text, reference preview, mention state, voice recording state, emoji panel, and extension panel.
  • FriendProvider: friend list, search, add, applications, accept, reject, delete, and remark updates.
  • GroupProvider: joined groups, search, create, details, members, management, applications, ownership transfer, and group profile updates.
  • NexconnUserProfileProvider: current-user and target-user profile loading for profile pages.

Main UI entry points

  • ChannelPage: default channel list screen.
  • ChatPage: chat screen for a BaseChannel.
  • MessageInputWidget: default input area used by ChatPage.
  • MessageBubble: default message bubble widget.
  • ForwardSelectPage, PhotoPreviewPage, ShortVideoPreviewPage, FilePreviewPage, and CombineMessageDetailPage: supporting chat pages.
  • FriendPage, FriendSearchPage, FriendAddPage, and FriendApplicationsPage: friend UI.
  • GroupPage, GroupDetailPage, GroupMembersPage, GroupManagePage, and related group pages.
  • NexconnUserProfilePage: user profile UI.

Data flow

  1. Your Flutter app obtains a user token from your own server.
  2. The app initializes and connects through EngineProvider.
  3. ChannelPage creates or receives a ChannelProvider and loads channels from the Nexconn SDK.
  4. Selecting a channel opens ChatPage with the selected BaseChannel.
  5. ChatPage creates or receives a ChatProvider, loads messages, and sends message params through BaseChannel.
  6. Incoming SDK events reach EngineProvider; scoped providers refresh the visible UI.

Design principles

  • Public APIs use Nexconn, Channel, Chat, Friend, and Group naming.
  • SDK objects are reused directly instead of duplicated in the UI layer.
  • Business data is injectable through resolvers, callbacks, and config objects.
  • Platform permissions and business-specific flows stay in your app.
  • Unsupported platform or business features are exposed as callbacks, disabled by default, or omitted from the default UI.