chatify_image_message 0.0.3
chatify_image_message: ^0.0.3 copied to clipboard
Chatify's image message implementation.
Chatify Image Message #
Image message provider for Chatify. Defines ImageMessage content and an ImageMessageProvider that renders images and provides a composer action to pick images and upload them using your configured AttachmentUploader.
Installation #
flutter pub add chatify_image_message
Usage #
Register the provider when initializing Chatify:
import 'package:chatify/chatify.dart';
import 'package:chatify_image_message/chatify_image_message.dart';
await Chatify.init(
currentUser: currentUser,
chatRepo: chatRepo,
messageRepoFactory: (chat) => messageRepoFor(chat),
uploaderFactory: (attachment) => uploaderFor(attachment),
messageProviders: [
ImageMessageProvider(),
],
);
The provider adds a composer action labelled “Image” that returns MediaComposerResult items with thumbnail, dimensions, and bytes. Chatify uploads using your AttachmentUploader, then calls MessageRepo.add(...) with the final URL.
API #
ImageMessageextendsMessageContentwith:thumbnail(bytes),width,heightImageMessageProviderextendsMediaMessageProvider<ImageMessage>and exposes a composer actionImageMessageWidgetdisplays image with upload/download progress, cancel/retry, and full-screen preview