* feat: version docs and add stream_member_list_controller docs * feat: add member list and grid doc * exported extensions on ui package * feat: add first version of v5 migration guide * docs: grammar fixes and other v5 release details * docs: add additional v5 migration info * update WrapAttachmentWidget doc * add back v4 migration guide * docs(doc): add customize_attachment_picker_modal.mdx guide. (#1343) Signed-off-by: xsahil03x <[email protected]> Signed-off-by: xsahil03x <[email protected]> * update link for attachment picker guide * update share_plus Signed-off-by: xsahil03x <[email protected]> Co-authored-by: Gordon Hayes <[email protected]> Co-authored-by: Sahil Kumar <[email protected]>
42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|
|
|
/// {@template streamSystemMessage}
|
|
/// {@endtemplate}
|
|
class StreamSystemMessage extends StatelessWidget {
|
|
/// {@macro streamSystemMessage}
|
|
const StreamSystemMessage({
|
|
super.key,
|
|
required this.message,
|
|
this.onMessageTap,
|
|
});
|
|
|
|
/// The message to display.
|
|
final Message message;
|
|
|
|
/// The action to perform when tapping on the message.
|
|
final void Function(Message)? onMessageTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = StreamChatTheme.of(context);
|
|
final message = this.message.replaceMentions(linkify: false);
|
|
|
|
final messageText = message.text;
|
|
if (messageText == null) return const SizedBox.shrink();
|
|
|
|
return GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTap: onMessageTap == null ? null : () => onMessageTap!(message),
|
|
child: Text(
|
|
messageText,
|
|
textAlign: TextAlign.center,
|
|
softWrap: true,
|
|
style: theme.textTheme.captionBold.copyWith(
|
|
color: theme.colorTheme.textLowEmphasis,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|