fix(ui): substitute mentioned user ids with user names in system message (#1278)
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -3,7 +3,10 @@
|
|||||||
🐞 Fixed
|
🐞 Fixed
|
||||||
|
|
||||||
- [[#1247]](https://github.com/GetStream/stream-chat-flutter/issues/1247) Fix Jiffy initialization.
|
- [[#1247]](https://github.com/GetStream/stream-chat-flutter/issues/1247) Fix Jiffy initialization.
|
||||||
- [[#1232]](https://github.com/getstream/stream-chat-flutter/issues/1232) Fix DateDivider not showing up in the chat.
|
- [[#1232]](https://github.com/getstream/stream-chat-flutter/issues/1232) Fix DateDivider not
|
||||||
|
showing up in the chat.
|
||||||
|
- [[#1240]](https://github.com/getstream/stream-chat-flutter/issues/1240) Substitute mentioned user
|
||||||
|
ids with user names in system message.
|
||||||
|
|
||||||
## 4.4.0
|
## 4.4.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stream_chat_flutter/src/extension.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
/// {@macro system_message}
|
/// {@macro system_message}
|
||||||
@@ -21,16 +22,22 @@ class StreamSystemMessage extends StatelessWidget {
|
|||||||
|
|
||||||
/// The function called when tapping on the message
|
/// The function called when tapping on the message
|
||||||
/// when the message is not failed
|
/// when the message is not failed
|
||||||
|
// TODO: Convert it to a simple OnTap instead.
|
||||||
final void Function(Message)? onMessageTap;
|
final void Function(Message)? onMessageTap;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = StreamChatTheme.of(context);
|
final theme = StreamChatTheme.of(context);
|
||||||
|
final message = this.message.replaceMentions();
|
||||||
|
|
||||||
|
final messageText = message.text;
|
||||||
|
if (messageText == null) return const SizedBox.shrink();
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: onMessageTap == null ? null : () => onMessageTap!(message),
|
onTap: onMessageTap == null ? null : () => onMessageTap!(message),
|
||||||
child: Text(
|
child: Text(
|
||||||
message.text!,
|
messageText,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
style: theme.textTheme.captionBold.copyWith(
|
style: theme.textTheme.captionBold.copyWith(
|
||||||
|
|||||||
Reference in New Issue
Block a user