88
99This guide includes breaking changes grouped by release phase:
1010
11+ ### 🚧 v10.0.0-beta.7
12+
13+ - [ MessageState] ( #-messagestate )
14+
1115### 🚧 v10.0.0-beta.4
1216
1317- [ SendReaction] ( #-sendreaction )
@@ -28,6 +32,77 @@ This guide includes breaking changes grouped by release phase:
2832
2933---
3034
35+ ## 🧪 Migration for v10.0.0-beta.7
36+
37+ ### 🛠 MessageState
38+
39+ #### Key Changes:
40+
41+ - ` MessageState ` factory constructors now accept ` MessageDeleteScope ` instead of ` bool hard ` parameter
42+ - Pattern matching callbacks in state classes now receive ` MessageDeleteScope scope ` instead of ` bool hard `
43+ - New delete-for-me functionality with dedicated states and methods
44+
45+ #### Migration Steps:
46+
47+ ** Before:**
48+ ``` dart
49+ // Factory constructors with bool hard
50+ final deletingState = MessageState.deleting(hard: true);
51+ final deletedState = MessageState.deleted(hard: false);
52+ final failedState = MessageState.deletingFailed(hard: true);
53+
54+ // Pattern matching with bool hard
55+ message.state.whenOrNull(
56+ deleting: (hard) => handleDeleting(hard),
57+ deleted: (hard) => handleDeleted(hard),
58+ deletingFailed: (hard) => handleDeletingFailed(hard),
59+ );
60+ ```
61+
62+ ** After:**
63+ ``` dart
64+ // Factory constructors with MessageDeleteScope
65+ final deletingState = MessageState.deleting(
66+ scope: MessageDeleteScope.hardDeleteForAll,
67+ );
68+ final deletedState = MessageState.deleted(
69+ scope: MessageDeleteScope.softDeleteForAll,
70+ );
71+ final failedState = MessageState.deletingFailed(
72+ scope: MessageDeleteScope.deleteForMe(),
73+ );
74+
75+ // Pattern matching with MessageDeleteScope
76+ message.state.whenOrNull(
77+ deleting: (scope) => handleDeleting(scope.hard),
78+ deleted: (scope) => handleDeleted(scope.hard),
79+ deletingFailed: (scope) => handleDeletingFailed(scope.hard),
80+ );
81+
82+ // New delete-for-me functionality
83+ channel.deleteMessageForMe(message); // Delete only for current user
84+ client.deleteMessageForMe(messageId); // Delete only for current user
85+
86+ // Check delete-for-me states
87+ if (message.state.isDeletingForMe) {
88+ // Handle deleting for me state
89+ }
90+ if (message.state.isDeletedForMe) {
91+ // Handle deleted for me state
92+ }
93+ if (message.state.isDeletingForMeFailed) {
94+ // Handle delete for me failed state
95+ }
96+ ```
97+
98+ > ⚠️ ** Important:**
99+ > - All ` MessageState ` factory constructors now require ` MessageDeleteScope ` parameter
100+ > - Pattern matching callbacks receive ` MessageDeleteScope ` instead of ` bool hard `
101+ > - Use ` scope.hard ` to access the hard delete boolean value
102+ > - New delete-for-me methods are available on both ` Channel ` and ` StreamChatClient `
103+
104+ ---
105+
31106## 🧪 Migration for v10.0.0-beta.4
32107
33108### 🛠 SendReaction
@@ -429,6 +504,15 @@ StreamMessageWidget(
429504
430505## 🎉 You're Ready to Migrate!
431506
507+ ### For v10.0.0-beta.7:
508+ - ✅ Update ` MessageState ` factory constructors to use ` MessageDeleteScope ` parameter
509+ - ✅ Update pattern matching callbacks to handle ` MessageDeleteScope ` instead of ` bool hard `
510+ - ✅ Leverage new delete-for-me functionality with ` deleteMessageForMe ` methods
511+ - ✅ Use new state checking methods for delete-for-me operations
512+
513+ ### For v10.0.0-beta.4:
514+ - ✅ Update ` sendReaction ` method calls to use ` Reaction ` object instead of individual parameters
515+
432516### For v10.0.0-beta.3:
433517- ✅ Update attachment picker options to use ` SystemAttachmentPickerOption ` or ` TabbedAttachmentPickerOption `
434518- ✅ Handle new ` StreamAttachmentPickerResult ` return type from attachment picker
0 commit comments