-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): mark unread feature - UI (#1881)
* mark message as unread feature * jump to last read message * changelog * error handling * tweak * mark unread feature - ui * doc * localization tests * tweaks * tweaks * localizations tests * tweak * Add test coverage --------- Co-authored-by: Efthymis Sarmpanis <[email protected]>
- Loading branch information
Showing
27 changed files
with
759 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/stream_chat_flutter/lib/src/message_actions_modal/mark_unread_message_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:stream_chat_flutter/stream_chat_flutter.dart'; | ||
|
||
/// {@template markUnreadMessageButton} | ||
/// Allows a user to mark message (and all messages onwards) as unread. | ||
/// | ||
/// Used by [MessageActionsModal]. Should not be used by itself. | ||
/// {@endtemplate} | ||
class MarkUnreadMessageButton extends StatelessWidget { | ||
/// {@macro markUnreadMessageButton} | ||
const MarkUnreadMessageButton({ | ||
super.key, | ||
required this.onTap, | ||
}); | ||
|
||
/// The callback to perform when the button is tapped. | ||
final VoidCallback onTap; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final streamChatThemeData = StreamChatTheme.of(context); | ||
return InkWell( | ||
onTap: onTap, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 11, horizontal: 16), | ||
child: Row( | ||
children: [ | ||
StreamSvgIcon.messageUnread( | ||
color: streamChatThemeData.primaryIconTheme.color, | ||
size: 24, | ||
), | ||
const SizedBox(width: 16), | ||
Text( | ||
context.translations.markAsUnreadLabel, | ||
style: streamChatThemeData.textTheme.body, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.