Skip to content

docs(flutter): Add image preview and caption guide for UI Kit#329

Merged
swapnil-cometchat merged 1 commit intomainfrom
feature/flutter-uikit-v5-guide-media-caption-and-preview
Apr 9, 2026
Merged

docs(flutter): Add image preview and caption guide for UI Kit#329
swapnil-cometchat merged 1 commit intomainfrom
feature/flutter-uikit-v5-guide-media-caption-and-preview

Conversation

@anshuman-cometchat
Copy link
Copy Markdown
Contributor

Add Image Preview & Caption Guide for Flutter UI Kit

Description

Adds a new guide document (ui-kit/flutter/guide-image-caption.mdx) for the Image Preview & Caption feature in the CometChat Flutter UI Kit. The guide covers:

  • Inline image preview widget rendered above the composer via headerView when a user picks an image from gallery or camera
  • Caption display below image thumbnails in message bubbles using a custom CometChatMessageTemplate
  • Component specifications table and ASCII architecture diagram showing the full data flow from image pick through send to render
  • Step-by-step integration with code examples for all five extension points: attachmentOptions, headerView, stateCallBack, onSendButtonTap, and templates
  • Key gotchas table covering zero-width space trick, caption extraction timing, headerView vs showPanel, templates vs addTemplate, and iOS path encoding
  • docs.json updated to register ui-kit/flutter/guide-image-caption in the Flutter UI Kit Guides navigation group

No UIKit source files are modified — the guide uses only public extension points.

Related Issue(s)

N/A

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

The guide documents a working implementation in chat-uikit-flutter/master_app/lib/messages/. The two implementation files are:

  • messages.dart — state management, composer configuration, send interception, custom image template
  • image_preview_screen.dartInlineImagePreview widget

The approach avoids modifying any UIKit source code by leveraging five composer/message-list extension points. The guide includes a gotchas table documenting non-obvious behaviors discovered during implementation (zero-width space for send button enablement, caption extraction timing, mentions formatter panel conflicts, template merge semantics, iOS path encoding).

Screenshots (if applicable)

N/A — the guide contains an ASCII architecture diagram and component specification table. Actual UI screenshots should be captured from a running device and added before merge.

- Add new guide document for image preview and caption functionality
- Include inline image preview widget above composer during image selection
- Document caption display below image thumbnails in message bubbles
- Add component specifications and architecture diagrams
- Include integration steps with code examples for custom attachment options
- Update docs.json to register new guide in Flutter UI Kit navigation
@swapnil-cometchat swapnil-cometchat merged commit f247f4c into main Apr 9, 2026
3 checks passed
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 9, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Apr 9, 2026, 3:00 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants