Message Input Config
MessageInputConfig controls the built-in MessageInputWidget used by ChatPage. It exposes input modes, toolbar controls, extension-panel entries, emoji panel layout, mention hooks, voice hooks, permission hooks, and reference preview rendering.
Entry Point
ChatPage(
channel: channel,
config: ChatPageConfig(
inputConfig: MessageInputConfig(
hintText: 'Message',
enableVoiceInput: false,
toolbarControls: [MessageInputBarControl.emoji],
),
),
)
MessageInputConfig
Core fields:
hintTextenableVoiceInputenableEmojiPanelenableExtensionPaneltoolbarControlsextensionPluginsmaxLinesbackgroundColordecorationvoiceInputUnavailableTextemptyExtensionPanelTextemojiItems
Mention fields:
enableMentionmentionResolvermentionPickermentionCandidateBuilderemptyMentionCandidatesText
Voice fields:
voiceDraftResolvervoiceRecorderminimumVoiceRecordingDurationmaximumVoiceRecordingDurationvoiceInputActionText
Permission and sub-config fields:
onPermissionRequesttoolbarButtonConfigsreferencePreviewConfigemojiPanelConfigextensionPanelConfig
Toolbar Controls
toolbarControls orders the built-in controls:
MessageInputBarControl.voiceMessageInputBarControl.emojiMessageInputBarControl.extension
Use toolbarButtonConfigs to override icon, active icon, size, padding, color, active color, or visibility for a control.
On Android, the built-in input uses a compact trailing slot: when the text draft is empty it shows the extension + button, and when a draft exists it switches that same slot to the send button. The emoji button remains a separate control, and the voice button remains on the leading side. If the extension control is disabled or no extension plugin is available, the empty-draft trailing slot is hidden.
MessageInputConfig(
toolbarControls: const [
MessageInputBarControl.emoji,
MessageInputBarControl.extension,
],
toolbarButtonConfigs: {
MessageInputBarControl.extension: MessageInputButtonConfig(
icon: const Icon(Icons.add_circle_outline),
activeIcon: const Icon(Icons.cancel_outlined),
visible: true,
),
},
)
Extension Plugins
extensionPlugins controls the extension panel. Built-in plugin types are represented by MessageInputExtensionPluginType:
customphotovideocamerafilmingfilelocation
MessageInputExtensionPlugin fields:
idtitleicontypeenabledtooltipunavailableTextonTappermissionRequestmediaPathResolvermediaDraftResolverlocationResolverbuilderassetName
Default plugins include photo, video, camera, filming, and file. Their default asset names use the NexconnLightIcon/ resource directory. For default media actions, the UI layer can use built-in picker helpers. For custom location or business actions, provide onTap, locationResolver, or another resolver.
MessageInputConfig(
extensionPlugins: [
MessageInputExtensionPlugin.photo(title: 'Photo'),
MessageInputExtensionPlugin.file(title: 'File'),
MessageInputExtensionPlugin(
id: 'contact_card',
title: 'Contact',
icon: Icons.person_outline,
onTap: (context, plugin) async {
// Open your own picker and send a message through ChatProvider.
},
),
],
)
Emoji Panel
MessageInputEmojiPanelConfig fields:
backgroundColorheightrowCountcolumnCountemojiSizerowSpacingcolumnSpacingpaddingpageIndicatorConfigdeleteIconsendButtonConfigemojiItemBuilderdeleteButtonBuildersendButtonBuilder
MessageInputPanelIndicatorConfig fields:
activeColorinactiveColorsizespacingbottomPadding
MessageInputEmojiSendButtonConfig fields:
textwidthheightbackgroundColortextStyleborderRadiusmargin
MessageInputConfig(
emojiItems: const [':smile:', ':party:', ':thumbs_up:'],
emojiPanelConfig: MessageInputEmojiPanelConfig(
height: 240,
rowCount: 3,
columnCount: 7,
sendButtonConfig: MessageInputEmojiSendButtonConfig(text: 'Send'),
),
)
Reference Preview
MessageInputReferencePreviewConfig fields:
backgroundColorpaddingtextStylecloseIconbuilder
MessageInputConfig(
referencePreviewConfig: MessageInputReferencePreviewConfig(
backgroundColor: const Color(0xFFF3F4F6),
builder: (context, message, senderName, summary, onClose) {
return ListTile(
dense: true,
title: Text(senderName),
subtitle: Text(summary, maxLines: 1),
trailing: IconButton(
icon: const Icon(Icons.close),
onPressed: onClose,
),
);
},
),
)
Extension Panel
MessageInputExtensionPanelConfig fields:
itemsPerPagecrossAxisCountbackgroundColormainAxisSpacingcrossAxisSpacingpaddingpageIndicatorConfigheightitemRadiustitleAreaHeight
MessageInputConfig(
extensionPanelConfig: const MessageInputExtensionPanelConfig(
itemsPerPage: 8,
crossAxisCount: 4,
height: 224,
),
)
Permissions
MessageInputExtensionPlugin.permissionRequest has the highest priority for one plugin entry. MessageInputConfig.onPermissionRequest is the shared fallback. If neither is supplied, the built-in helper requests only the permissions needed by the selected default plugin:
photoandvideorequest photo-library/media-library access.camerarequests camera access only.filmingrequests camera and microphone for the direct Android recording flow.filmingkeeps the media-library permission step when using a non-direct recording or picker flow that needs gallery access.
Return false when the user denies permission or cancels the request. The input panel stops the action without sending a message.
Styling and dark mode
The default TextField decoration uses theme tokens. In dark mode or a custom theme, the default input fill follows NexconnThemeTokens.surfaceMutedColor, while text and placeholder colors continue to use the existing text tokens. If MessageInputConfig.decoration is provided, the custom decoration is used as-is and the SDK does not override its fillColor.
Voice Input
Use voiceRecorder to provide a recorder implementation, or voiceDraftResolver to provide an already-created MessageInputVoiceDraft. minimumVoiceRecordingDuration and maximumVoiceRecordingDuration control validation.
MessageInputConfig(
enableVoiceInput: true,
voiceRecorder: MessageInputDefaultVoiceRecorder(),
minimumVoiceRecordingDuration: const Duration(seconds: 1),
maximumVoiceRecordingDuration: const Duration(seconds: 60),
)