Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c91301
refactor(ui): rewrote message actions and modals
xsahil03x Mar 24, 2025
1a6485d
chore: Update Goldens
xsahil03x Mar 24, 2025
c64a6b8
fix: align message reactions as per message
xsahil03x Mar 25, 2025
782e9a7
chore: Update Goldens
xsahil03x Mar 25, 2025
47eda25
feat: add support for retrying bounced messages
xsahil03x Apr 28, 2025
7951b34
chore: fix translations formatting
xsahil03x Apr 28, 2025
0056602
feat: rebase with master and update moderation actions
xsahil03x Apr 28, 2025
dfc9a55
chore: Update Goldens
xsahil03x Apr 28, 2025
9f61c43
chore: remove redundant test
xsahil03x Apr 28, 2025
38156e9
refactor: introduce MessageAction sealed class
xsahil03x May 9, 2025
d17d28b
chore: Update Goldens
xsahil03x May 9, 2025
f802ea6
chore: trigger build
xsahil03x May 9, 2025
72653fd
chore: support onCustomActionTap in copyWith
xsahil03x May 9, 2025
ec54501
fix: handle empty fallback channel name
xsahil03x May 13, 2025
74a2740
chore: improve reaction picker
xsahil03x May 13, 2025
fbf014f
chore: export new widgets, classes
xsahil03x May 13, 2025
cce96ae
feat: export StreamMessageActionsBuilder
xsahil03x May 13, 2025
0598a31
chore: update CHANGELOG.md
xsahil03x May 13, 2025
6e99dcc
chore: fix lints
xsahil03x May 13, 2025
c2efae8
chore: Update Goldens
xsahil03x May 13, 2025
64b28d9
chore: update CHANGELOG.md
xsahil03x May 13, 2025
402ac1e
chore: make methods private
xsahil03x May 19, 2025
448445d
chore: use AlignmentDirectional instead of regular Alignment.
xsahil03x May 19, 2025
d5a5e5a
chore: make DownloadMenuItem private
xsahil03x May 19, 2025
ba76842
chore: simplify toCrossAxisAlignment extension impl
xsahil03x May 19, 2025
47b7381
chore: update doc
xsahil03x May 19, 2025
8e62c25
chore: fix lint
xsahil03x May 19, 2025
a185030
chore: update doc
xsahil03x May 22, 2025
b74a2d0
Merge remote-tracking branch 'origin/v10.0.0' into refactor/message-a…
xsahil03x May 22, 2025
9f138c2
chore: fix analysis
xsahil03x May 22, 2025
6ea980b
fix: fix alignment
xsahil03x May 22, 2025
2e35e57
fix: fix toColumnCrossAxisAlignment extension
xsahil03x May 22, 2025
16cd5dd
chore: remove unnecessary context
xsahil03x May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions packages/stream_chat/lib/src/client/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -987,20 +987,35 @@ class Channel {
}
}

/// Retry the operation on the message based on the failed state.
/// Retries operations on a message based on its failed state.
///
/// For example, if the message failed to send, it will retry sending the
/// message and vice-versa.
/// This method examines the message's state and performs the appropriate
/// retry action:
/// - For [MessageState.sendingFailed], it attempts to send the message.
/// - For [MessageState.updatingFailed], it attempts to update the message.
/// - For [MessageState.deletingFailed], it attempts to delete the message.
/// with the same 'hard' parameter that was used in the original request
/// - For messages with [isBouncedWithError], it attempts to send the message.
Future<Object> retryMessage(Message message) async {
assert(message.state.isFailed, 'Message state is not failed');
assert(
message.state.isFailed || message.isBouncedWithError,
'Only failed or bounced messages can be retried',
);

return message.state.maybeWhen(
failed: (state, _) => state.when(
sendingFailed: () => sendMessage(message),
updatingFailed: () => updateMessage(message),
deletingFailed: (hard) => deleteMessage(message, hard: hard),
),
orElse: () => throw StateError('Message state is not failed'),
orElse: () {
// Check if the message is bounced with error.
if (message.isBouncedWithError) return sendMessage(message);

throw StateError(
'Only failed or bounced messages can be retried',
);
},
);
}

Expand Down
28 changes: 28 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## Upcoming Beta

🛑️ Breaking

- `StreamReactionPicker` now requires reactions to be explicitly handled via `onReactionPicked`. *(Automatic handling is no longer supported.)*
- `StreamMessageAction` is now generic `(StreamMessageAction<T>)`, enhancing type safety. Individual onTap callbacks have been removed; actions are now handled centrally by widgets like `StreamMessageWidget.onCustomActionTap` or modals using action types.
- `StreamMessageReactionsModal` no longer requires the `messageTheme` parameter. The theme now automatically derives from the `reverse` property.

For more details, please refer to the [migration guide](Unpublished).

✅ Added

- Added new `StreamMessageActionsBuilder` which provides a list of actions to be displayed in the message actions modal.
- Added new `StreamMessageActionConfirmationModal` for confirming destructive actions like delete or flag.
- Added new `StreamMessageModal` and `showStreamMessageModal` for consistent message-related modals with improved transitions and backdrop effects.
```dart
showStreamMessageModal(
context: context,
...other parameters,
builder: (context) => StreamMessageModal(
...other parameters,
headerBuilder: (context) => YourCustomHeader(),
contentBuilder: (context) => YourCustomContent(),
),
);
```
- Exported `StreamMessageActionsModal` and `StreamModeratedMessageActionsModal` which are now based on `StreamMessageModal` for consistent styling and behavior.

## Upcoming

🐞 Fixed
Expand Down
5 changes: 5 additions & 0 deletions packages/stream_chat_flutter/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The existence of this file prevents warnings about unrecognized tags when running Alchemist tests.

tags:
golden:
timeout: 15s
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class StreamChannelAvatar extends StatelessWidget {

final fallbackWidget = Center(
child: Text(
channel.name?[0] ?? '',
channel.name?.characters.firstOrNull ?? '',
style: TextStyle(
color: colorTheme.barsBg,
fontWeight: FontWeight.bold,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading