Channel Drafts
Nexconn Chat UI keeps text drafts for each channel through the current BaseChannel and ChatProvider.
When a user types text and leaves the chat page before sending it, the input widget saves the draft after a short debounce. When the same channel is opened again, the draft is restored into the input field. Sending a message or clearing the input clears the stored draft.
Default Behavior
Draft handling is enabled by default when you use ChatPage with the standard MessageInputWidget.
The built-in flow:
- Reads the initial value from
channel.draft. - Saves non-empty input with
ChatProvider.saveDraft. - Clears empty or sent input with
ChatProvider.clearDraft. - Shows the draft in the channel list as the latest channel summary.
Manual Control
Use ChatProvider if your app owns a custom input field.
Dart
await chatProvider.saveDraft('Meet at 4?');
Dart
await chatProvider.clearDraft();
Dart
final draft = channel.draft;
Drafts are plain text. Attachments, reference state, mention metadata, and custom input panels are not persisted as part of the draft by Nexconn Chat UI.