flyer_chat_custom_message 0.0.13
flyer_chat_custom_message: ^0.0.13 copied to clipboard
Custom message package for Flutter chat apps, complementing flutter_chat_ui. #chat #ui
Flyer Chat 💬 Custom Message (Placeholder) #
Note: This package has no implementation and serves as a placeholder to showcase the pattern for handling custom message types within Flyer Chat.
Implementing Custom Messages #
To render your own custom messages:
- When creating a message instance that represents your custom data, use the custom message type provided by
flutter_chat_core. This type includes standard fields likeid,authorId,createdAt, etc. - Store your custom data within the
metadatafield (aMap<String, dynamic>) of the custom message. For simple cases, this might be all you need. If you intend to support several distinct types of custom messages, you could use thismetadatato help yourcustomMessageBuilderdecide which widget to display, for example, by including a specific key like'customType': 'poll'. - Use the
customMessageBuilderprovided by the mainflutter_chat_uipackage'sBuildersto render your widget based on the message instance passed to the builder.
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
Chat(
builders: Builders(
customMessageBuilder: (context, message, index, {
required bool isSentByMe,
MessageGroupStatus? groupStatus,
}) =>
const SizedBox.shrink(),
),
);