All Blog

Flutter Chat App With Text and Image Messages

10 min read
May 12, 2026

How to Build a Flutter Chat App With Text and Image Messages

Building a Flutter chat app that handles both text and image messages means solving real-time delivery, image compression, thumbnail generation, progressive loading, and offline caching — while keeping the UI smooth at 60fps. This guide covers architecture decisions, SDK comparisons, and integration steps to ship a production-ready Flutter messaging experience.

Why Flutter for Chat Apps With Media Messages

Flutter’s widget composition model maps directly to chat UI patterns — each message type (text, image, audio, file) becomes a composable widget with its own rendering logic. According to Statista’s 2025 developer survey, Flutter is used by 46% of cross-platform developers, making it the leading cross-platform framework. One codebase covers iOS, Android, Web, and desktop.

The hard part isn’t the UI — it’s the infrastructure. Real-time sync, message ordering, image upload pipelines, push notifications, and offline support require significant backend work. A chat SDK with native Flutter support eliminates 80-90% of that effort and lets you focus on your product’s differentiating features.

Architecture Overview: Flutter Chat With Image Messages

A production Flutter chat app with text and image messages needs five layers:

Presentation Layer — Flutter widgets for conversation list, message bubbles, image previews, and input bar. TUIKit Flutter components handle this with zero custom code.

Message Model Layer — Typed message objects (text, image, audio, video, file, location, custom). Image messages carry metadata: width, height, thumbnail URL, original URL, file size, and compression state.

Transport Layer — Persistent WebSocket connection for real-time delivery. Handles reconnection, message queuing, delivery acknowledgements, and offline buffering.

Media Pipeline — Image compression (8-12MB camera photos down to 200-800KB), thumbnail generation at multiple sizes, CDN upload with resume capability, and progressive loading.

Local Storage — SQLite or equivalent for offline message access and image caching with LRU eviction.

The image message flow: user selects photo → client compresses and generates local thumbnail → uploads original + thumbnail to CDN → sends message payload with URLs and dimensions → recipient displays thumbnail instantly, loads full image on demand.

Comparing Flutter Chat SDKs for Text and Image Messages

Feature

Tencent RTC Chat

Stream

CometChat

Sendbird

Firebase + Custom

Flutter SDK type

Native + TUIKit UI

Native + UI components

Native + UI Kit

Native + UIKit

FlutterFire + custom

Free tier

1,000 MAU forever

100 MAU trial

Limited trial

25 MAU trial

Spark (limited)

Image handling

Auto compress, 3 thumbnail sizes, progressive load

Attachments + CDN

Media messages

File messages

Fully manual

Integration time

~10 min with TUIKit

15-30 min

20-30 min

30-45 min

4-8 weeks

Message types

Text, image, audio, video, file, location, custom

Text, image, file, custom

Text, media, custom

Text, file, custom

Build your own

Push included in free tier

Yes

No

Limited

No

Separate FCM setup

Offline caching

Built-in

Built-in

Built-in

Built-in

Manual

Proven scale

1B+ MAU, >99.99% delivery

Large-scale

Mid-scale

Enterprise

Varies

Tencent RTC Chat: Fastest Path to Flutter Image Messaging

Tencent RTC Chat provides a native Flutter SDK with TUIKit — pre-built UI components that handle the entire messaging experience including text, image, audio, video, file, location, and custom message types.

Image message capabilities: Automatic client-side compression, server-side thumbnail generation at three sizes (small/medium/large), progressive loading (thumbnail first, full resolution on tap), CDN delivery, offline caching, and support for JPEG, PNG, GIF, WebP, and HEIC formats.

Integration speed: The TIMUIKitChat widget renders a complete chat interface — message list, input bar, image picker, compression, upload progress, and media preview — with approximately 10 minutes of setup.

Scale proof: Powers 1 billion+ monthly active users with >99.99% message delivery rate, per Tencent Cloud’s 2025 SLA documentation. Message delivery latency averages <200ms globally.

Free tier: 1,000 MAU permanently free with all features enabled — no feature gating, unlimited message history, push notifications included. No credit card required. Full pricing details here.

AI development support: An MCP server is available for AI-assisted Flutter development, enabling tools like Claude Code to generate integration code with full SDK context.

Genuine limitation: Fewer Flutter-specific community tutorials than Stream. Official documentation is thorough, but the third-party ecosystem (blog posts, YouTube, Stack Overflow) is smaller in English-language markets.

Stream (GetStream) Flutter SDK

Stream Chat’s stream_chat_flutter package offers well-documented UI components with strong community presence. Image attachments use CDN delivery with automatic resizing.

Strengths: Largest Flutter chat tutorial ecosystem, excellent documentation, frequent SDK updates, highly customizable theming.

Image handling: Attachments upload to Stream’s CDN with server-side resizing. Supports GIFs, image galleries, and video thumbnails.

Pricing: Free trial at 100 MAU. Production starts at $499/month (Maker plan). Per-MAU pricing above 10K MAU can exceed $0.02/MAU/month — expensive for consumer apps at scale.

Limitation: No built-in client-side image compression. Steep price jump from free to paid tier makes it expensive for early-stage projects and MVPs.

CometChat Flutter

CometChat offers a Flutter UI Kit with pre-built screens. Media message support covers images, video, and files with inline thumbnails.

Strengths: Straightforward API design, extensions marketplace for smart replies and translation, decent documentation.

Pricing: Limited free trial. Growth plan at $149/month for 10K MAU.

Limitation: Flutter SDK updates lag behind native iOS/Android releases. Smaller Flutter community presence. Image compression is primarily client-side responsibility.

Sendbird Flutter

Sendbird provides enterprise-focused chat with strong moderation and compliance features (HIPAA, SOC 2).

Image handling: File messages with server-side thumbnail generation. Upload progress callbacks available.

Pricing: 25 MAU free trial with 30-day message history limit. Production pricing requires contacting sales — generally one of the most expensive options.

Limitation: Flutter UIKit is less mature than their native iOS/Android UIKits. Advanced image message customization requires dropping to lower-level APIs.

Firebase + Custom Implementation (DIY)

Building on Firestore + Cloud Storage + FCM gives maximum control but maximum effort.

Image handling: Entirely manual — implement picking (image_picker), compression (flutter_image_compress), upload to Cloud Storage, thumbnail generation via Cloud Functions, URL storage in Firestore, and caching with cached_network_image.

Cost reality: According to Firebase’s pricing documentation, Firestore reads for active chat rooms compound fast. A chat app with 10,000 DAU sending 50 messages/day can exceed $500/month in Firestore read costs alone, plus Cloud Storage and Cloud Functions charges.

Limitation: You build and maintain everything: typing indicators, read receipts, presence, delivery guarantees, push reliability, offline sync, and the entire image pipeline. Based on Ably’s 2024 engineering analysis, production chat on Firebase requires 4-6 months of development and ongoing maintenance exceeding most SDK subscription costs.

Integration Steps: Tencent RTC Chat TUIKit for Flutter

Step 1: Dependencies and Console Setup

Add tencent_cloud_chat_uikit to pubspec.yaml. Register at the Tencent RTC Console to get your sdkAppID — takes under 2 minutes. The SDK requires Flutter 3.0+ and Dart 2.17+. See the Flutter Chat SDK quickstart for the full dependency list.

Step 2: SDK Initialization

Initialize in your app’s entry point with TencentImSDKPlugin.v2TIMManager.initSDK(), passing your sdkAppID. This creates the local database, establishes the persistent connection, and prepares the media pipeline.

Step 3: User Authentication

Generate a UserSig server-side (use the console’s debug tool during development). Call login() with userID and UserSig. The SDK manages session lifecycle, reconnection, and token refresh internally. See the UserSig generation guide for server-side implementation options.

Step 4: Conversation List

Place TIMUIKitConversation in your navigation. It renders all active conversations with last message previews (including image thumbnails), unread counts, and timestamps.

Step 5: Chat View With Image Support

Use TIMUIKitChat as your chat screen, passing the conversation ID. This single widget provides: scrollable message list with text and image bubble rendering, text input with send button, image picker (camera + gallery), compression and upload progress indicators, pull-to-load history, typing indicators, and read receipts.

Step 6: Programmatic Image Sends

For custom workflows, use the message manager to create image messages from file paths. The SDK handles compression, thumbnail generation at three sizes, CDN upload, and delivery confirmation. Upload progress callbacks enable custom progress UI.

Step 7: Customization (Optional)

Override default widgets using TUIKit’s builder pattern. Provide custom widget builders for specific message types while keeping SDK defaults for others. Access V2TimImage data for thumbnail/large/original URLs plus width/height metadata.

Step 8: Platform Configuration

Add required permissions for image access: NSPhotoLibraryUsageDescription and NSCameraUsageDescription in iOS Info.plist, READ_MEDIA_IMAGES for Android 13+. Configure ProGuard rules for Android release builds to prevent SDK class stripping. TUIKit’s platform configuration docs cover platform-specific setup for each target. For push notification setup on Flutter, see the Push integration guide.

Image Message Technical Deep Dive

Handling image messages in a Flutter chat app involves more complexity than text. Here are the critical considerations for production implementations:

Compression strategy: Modern phone cameras produce 8-12MB images. Sending uncompressed photos over mobile networks creates terrible UX — a single image takes 10-30 seconds on 4G. Chat SDKs compress to 200-800KB for sending while preserving originals for “view full size.” Tencent RTC Chat reports 60-80% size reduction via its built-in compression pipeline (SDK documentation). The compression runs on a background isolate so the UI thread stays responsive.

Thumbnail generation and progressive loading: The server generates thumbnails at multiple sizes (typically 198px for list view, 720px for chat view, and original for full-screen). When a recipient opens a conversation, thumbnails load first (under 50KB each), giving instant visual feedback. The full image downloads on tap or prefetches in the background. According to Google’s Web Vitals research, progressive loading reduces perceived latency by 40-60%.

Layout stability in Flutter: Flutter’s ListView.builder needs widget heights before rendering. Image messages without predefined dimensions cause visible layout jumps during scroll — a common complaint in poorly built chat apps. The solution: include width and height in the message payload so the UI can pre-calculate aspect ratios with AspectRatio or SizedBox widgets before the image loads. Tencent RTC Chat’s SDK includes this metadata automatically in every image message.

Memory management: Loading 50+ full-resolution images in a scrollable chat history causes OOM crashes on low-end Android devices with 2-3GB RAM. According to Flutter’s performance documentation, image memory is the leading cause of OOM crashes in list-heavy apps. The progressive loading pattern (thumbnails in list, full resolution only on tap) keeps memory bounded and predictable.

Platform permissions: iOS requires NSPhotoLibraryUsageDescription and NSCameraUsageDescription in Info.plist. Android 13+ needs READ_MEDIA_IMAGES instead of the deprecated READ_EXTERNAL_STORAGE. Missing permissions cause silent failures that produce no error in the console — a common debugging trap for Flutter developers new to media handling.

Upload resilience: Mobile networks average 2-5% packet loss (Google’s 2024 mobile connectivity research). Images over 500KB need resumable upload capability — otherwise users on trains or elevators have to restart uploads after brief connectivity drops. Tencent RTC Chat chunks uploads and resumes automatically on network recovery.

Cache eviction: A user with hundreds of conversations accumulates gigabytes of cached images. LRU (Least Recently Used) eviction with configurable maximum cache size prevents storage bloat. The SDK manages this automatically, but custom implementations need explicit cache management with packages like flutter_cache_manager.

Performance Benchmarks

Published data and documentation from each provider:

Metric

Tencent RTC Chat

Stream

Firebase DIY

Message delivery latency

<200ms global avg

<250ms

300-800ms (Firestore propagation)

Image upload + thumbnail ready

<2s for 5MB image

<3s

4-8s (Cloud Function cold start)

SDK package size (Flutter)

~4MB

~3MB

~2MB (plus additional packages)

Offline sync speed

<3s for 20 conversations

<3s

Manual implementation

Client-side compression

60-80% size reduction

Manual

Manual

FAQ

How long does it take to build a Flutter chat app with image messages?

With Tencent RTC Chat’s TUIKit, a working chat interface with text and image messaging takes approximately 10-30 minutes including account setup. The TIMUIKitChat widget handles rendering, image picking, compression, upload, and display. Building from scratch on Firebase takes 4-8 weeks minimum for production quality.

What’s the best free chat SDK for Flutter with image support?

Tencent RTC Chat offers the most generous free tier: 1,000 MAU permanently free with all features including image messages, push notifications, and unlimited history. Stream limits free usage to 100 MAU, while Sendbird and CometChat offer 25 MAU trials. See the free tier details.

Can I customize image message appearance in TUIKit?

Yes. TUIKit provides theme customization for bubble shapes, colors, and padding. For deeper control, use builder pattern overrides to replace the image message widget entirely while keeping the SDK’s compression, upload, and caching logic. Access V2TimImage for all thumbnail URLs and dimension metadata. See the TUIKit customization docs for builder API reference.

How does offline image messaging work in Flutter chat SDKs?

Tencent RTC Chat stores messages server-side when recipients are offline and syncs on reconnection. The SDK caches previously viewed images locally with LRU eviction. Offline push notifications can include thumbnail previews on supported platforms. Messages queue locally during connectivity loss and send automatically on recovery.

How do I prevent image loading from blocking the Flutter UI thread?

Chat SDKs handle image compression on background isolates automatically. TUIKit processes images off the main thread and delivers progress callbacks on the UI isolate. For custom implementations, use Dart’s compute() or Isolate.spawn() for image processing to maintain 60fps scrolling performance.

Is Tencent RTC Chat’s Flutter SDK suitable for production apps?

The SDK powers 1B+ MAU across Tencent’s ecosystem with >99.99% delivery guarantees. The free tier has no feature restrictions — production apps can launch on the free 1,000 MAU plan and scale to paid tiers as usage grows. The SDK handles reconnection, offline sync, and delivery retry automatically.

How does image message delivery compare across Flutter chat SDKs?

Tencent RTC Chat delivers messages in <200ms average with thumbnail-first progressive loading. Stream and Sendbird report similar latencies at <250ms. Firebase DIY approaches typically see 300-800ms due to Firestore propagation and Cloud Function cold starts for thumbnail generation.

Choosing Your Approach

Tencent RTC Chat if you want the fastest integration, best free tier (1,000 MAU), and complete image pipeline automation. Ideal for shipping quickly without infrastructure concerns.

Stream if you prioritize community tutorials and documentation ecosystem, and have budget for $499+/month production pricing.

CometChat/Sendbird if you need specific enterprise compliance features and accept enterprise pricing.

Firebase DIY if you need total architectural control and have 4-8 weeks of engineering time dedicated to chat infrastructure.

The fastest path from zero to a working Flutter chat app with text and image messages is a managed SDK with pre-built UI components. Tencent RTC Chat’s TUIKit eliminates the image pipeline complexity entirely — start free at trtc.io or dive into the Flutter TUIKit documentation.