1
- # 🚀 Flutter SDK v10.0 Migration Guide
1
+ # 🚀 Flutter SDK v10 Migration Guide
2
2
3
- ** Important!** This guide details breaking changes in ** SDK v10.0** . Carefully follow each step to ensure a smooth and efficient migration .
3
+ ** Important!** This guide outlines all breaking changes introduced in the Flutter SDK ** v10.0.0 ** release, including pre-release stages like ` v10.0.0-beta.1 ` . Follow each section based on the version you're migrating from .
4
4
5
5
---
6
6
@@ -10,26 +10,24 @@ This guide includes breaking changes grouped by release phase:
10
10
11
11
### 🚧 v10.0.0-beta.1
12
12
13
- - [ ** StreamReactionPicker** ] ( #-streamreactionpicker-refactor )
14
- - [ ** StreamMessageAction** ] ( #-streammessageaction-refactor )
15
- - [ ** StreamMessageReactionsModal** ] ( #-streammessagereactionsmodal-refactor )
16
- - [ ** StreamMessageWidget** ] ( #-streammessagewidget-refactor )
13
+ - [ StreamReactionPicker] ( #-streamreactionpicker )
14
+ - [ StreamMessageAction] ( #-streammessageaction )
15
+ - [ StreamMessageReactionsModal] ( #-streammessagereactionsmodal )
16
+ - [ StreamMessageWidget] ( #-streammessagewidget )
17
17
18
18
---
19
19
20
20
## 🧪 Migration for v10.0.0-beta.1
21
21
22
- ### 🛠 StreamReactionPicker Refactor
22
+ ### 🛠 StreamReactionPicker
23
23
24
- The reaction picker has been refactored for modularity, flexibility, and explicit reaction handling.
24
+ #### Key Changes:
25
25
26
- ### Key Changes:
27
- ** Key Changes:**
28
26
- New ` StreamReactionPicker.builder ` constructor
29
27
- Added properties: ` padding ` , ` scrollable ` , ` borderRadius `
30
- - Removed automatic reaction handling → use ` onReactionPicked `
28
+ - Automatic reaction handling removed — must now use ` onReactionPicked `
31
29
32
- ### Migration Steps:
30
+ #### Migration Steps:
33
31
34
32
** Before:**
35
33
``` dart
@@ -38,24 +36,24 @@ StreamReactionPicker(
38
36
);
39
37
```
40
38
41
- ** After (Recommended using Builder):**
39
+ ** After (Recommended – Builder):**
42
40
``` dart
43
41
StreamReactionPicker.builder(
44
42
context,
45
43
message,
46
44
(Reaction reaction) {
47
- // Explicitly handle reaction here
45
+ // Explicitly handle reaction
48
46
},
49
47
);
50
48
```
51
49
52
- ** After (Alternative Direct Configuration):**
50
+ ** After (Alternative – Direct Configuration):**
53
51
``` dart
54
52
StreamReactionPicker(
55
53
message: message,
56
54
reactionIcons: StreamChatConfiguration.of(context).reactionIcons,
57
55
onReactionPicked: (Reaction reaction) {
58
- // Explicit reaction handling
56
+ // Handle reaction here
59
57
},
60
58
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
61
59
scrollable: true,
@@ -64,51 +62,32 @@ StreamReactionPicker(
64
62
```
65
63
66
64
> ⚠️ ** Important:**
67
- > Automatic reaction handling has been removed. You must explicitly handle reactions.
68
-
69
- ### Summary of Changes:
70
-
71
- | Aspect | Previous | New Behavior |
72
- | ------------------------| ---------------| ----------------------------------------------|
73
- | Reaction Handling | Automatic | Explicit (` onReactionPicked ` ) |
74
- | Platform Constructor | None | Yes (` StreamReactionPicker.builder ` ) |
75
- | Customization | Limited | Enhanced (` padding ` , ` borderRadius ` , ` scrollable ` ) |
65
+ > Automatic reaction handling has been removed. You must explicitly handle reactions using ` onReactionPicked ` .
76
66
77
67
---
78
68
79
- ## ✅ StreamMessageAction Refactor
69
+ ### 🛠 StreamMessageAction
80
70
81
- The ` StreamMessageAction ` is refactored for type safety, centralization, and enhanced customization.
71
+ #### Key Changes:
82
72
83
- ### Key Changes:
84
- - ** Type-safe Actions:** Now generic (` StreamMessageAction<T extends MessageAction> ` ) for stronger typing.
85
- - ** Centralized Action Handling:** Individual action callbacks replaced with centralized handling via ` onCustomActionTap ` .
86
- - ** Customization Options:** New props:
87
- - ` isDestructive ` : Flag destructive actions.
88
- - ` iconColor ` : Customize icon color.
89
- - ` titleTextColor ` : Title color customization.
90
- - ` titleTextStyle ` : Title text styling.
91
- - ` backgroundColor ` : Background color customization.
73
+ - Now generic: ` StreamMessageAction<T extends MessageAction> `
74
+ - Individual ` onTap ` handlers removed — use ` onCustomActionTap ` instead
75
+ - Added new styling props for better customization
92
76
93
- ### Migration Steps:
77
+ #### Migration Steps:
94
78
95
79
** Before:**
96
80
``` dart
97
81
final customAction = StreamMessageAction(
98
82
title: Text('Custom Action'),
99
83
leading: Icon(Icons.settings),
100
- onTap: (Message message) {
84
+ onTap: (message) {
101
85
// Handle action
102
86
},
103
87
);
104
-
105
- StreamMessageWidget(
106
- message: message,
107
- customActions: [customAction],
108
- );
109
88
```
110
89
111
- ** After (Recommended - Type-safe):**
90
+ ** After (Type-safe):**
112
91
``` dart
113
92
final customAction = StreamMessageAction<CustomMessageAction>(
114
93
action: CustomMessageAction(
@@ -125,132 +104,85 @@ StreamMessageWidget(
125
104
message: message,
126
105
customActions: [customAction],
127
106
onCustomActionTap: (CustomMessageAction action) {
128
- // Handle action based on extraData
107
+ // Handle action here
129
108
},
130
109
);
131
110
```
132
111
133
112
> ⚠️ ** Important:**
134
- > Individual ` onTap ` callbacks have been removed. Always use centralized ` onCustomActionTap ` .
135
-
136
- ### Summary of Changes:
137
-
138
- | Aspect | Previous | New Behavior |
139
- | ------------------| --------------------------------| ------------------------------------------|
140
- | Action Typing | Untyped | Generic (type-safe) |
141
- | Action Handling | Individual ` onTap ` callbacks | Centralized (` onCustomActionTap ` ) |
142
- | Customization | Limited | Enhanced (` iconColor ` , ` backgroundColor ` , etc.) |
113
+ > Individual ` onTap ` callbacks have been removed. Always handle actions using the centralized ` onCustomActionTap ` .
143
114
144
115
---
145
116
146
- ## ✅ StreamMessageReactionsModal Refactor
117
+ ### 🛠 StreamMessageReactionsModal
147
118
148
- Refactored to leverage ` StreamMessageModal ` , improving consistency and explicit reaction handling.
119
+ #### Key Changes:
149
120
150
- ### Key Changes:
151
- - ** Base Widget Changed:** Now uses ` StreamMessageModal ` internally.
152
- - ** Removed ` messageTheme ` Property:** Theme now automatically derived from ` reverse ` .
153
- - ** Explicit Reaction Handling:** Reactions must be handled explicitly through ` onReactionPicked ` .
121
+ - Based on ` StreamMessageModal ` for consistency
122
+ - ` messageTheme ` removed — inferred automatically
123
+ - Reaction handling must now be handled via ` onReactionPicked `
154
124
155
- ### Migration Steps:
125
+ #### Migration Steps:
156
126
157
- ** Step 1: Remove ` messageTheme ` :**
127
+ ** Before :**
158
128
``` dart
159
- // Before
160
- StreamMessageReactionsModal(
161
- message: message,
162
- messageWidget: myMessageWidget,
163
- messageTheme: myCustomMessageTheme, // remove this
164
- reverse: true,
165
- );
166
-
167
- // After
168
129
StreamMessageReactionsModal(
169
130
message: message,
170
131
messageWidget: myMessageWidget,
132
+ messageTheme: myCustomMessageTheme,
171
133
reverse: true,
172
134
);
173
135
```
174
136
175
- ** Step 2: Explicit Reaction Handling :**
137
+ ** After :**
176
138
``` dart
177
- // Before (automatic handling)
178
- StreamMessageReactionsModal(
179
- message: message,
180
- messageWidget: myMessageWidget,
181
- // reactions handled internally
182
- );
183
-
184
- // After (explicit handling)
185
139
StreamMessageReactionsModal(
186
140
message: message,
187
141
messageWidget: myMessageWidget,
142
+ reverse: true,
188
143
onReactionPicked: (SelectReaction reactionAction) {
189
- // Explicitly send or delete reaction
144
+ // Handle reaction explicitly
190
145
},
191
146
);
192
147
```
193
148
194
149
> ⚠️ ** Important:**
195
- > Automatic handling is removed—explicit reaction handling required.
196
-
197
- ### Summary of Changes:
198
-
199
- | Aspect | Previous | New Behavior |
200
- | --------------------| ---------------------------| ------------------------------------|
201
- | Reaction Handling | Automatic | Explicit (` onReactionPicked ` ) |
202
- | Base Widget | Custom implementation | Uses ` StreamMessageModal ` |
203
- | ` messageTheme ` Prop| Required | Removed; derived from ` reverse ` |
150
+ > ` messageTheme ` has been removed. Reaction handling must now be explicit using ` onReactionPicked ` .
204
151
205
152
---
206
153
207
- ## ✅ StreamMessageWidget Refactor
154
+ ### 🛠 StreamMessageWidget
208
155
209
- The ` StreamMessageWidget ` has been simplified by removing the ` showReactionTail ` parameter and always showing the reaction picker tail when the reaction picker is visible.
156
+ #### Key Changes:
210
157
211
- ### Key Changes:
212
- - ** Removed ` showReactionTail ` Parameter:** The parameter is no longer needed as the tail is always shown when the reaction picker is visible.
213
- - ** Automatic Tail Display:** The reaction picker tail now automatically appears when the reaction picker is visible, providing consistent UX.
158
+ - ` showReactionTail ` parameter has been removed
159
+ - Tail now automatically shows when the picker is visible
214
160
215
- ### Migration Steps:
161
+ #### Migration Steps:
216
162
217
163
** Before:**
218
164
``` dart
219
165
StreamMessageWidget(
220
166
message: message,
221
- showReactionTail: true, // Remove this parameter
222
- );
223
-
224
- // or
225
-
226
- StreamMessageWidget(
227
- message: message,
228
- showReactionTail: false, // Remove this parameter
167
+ showReactionTail: true,
229
168
);
230
169
```
231
170
232
171
** After:**
233
172
``` dart
234
173
StreamMessageWidget(
235
174
message: message,
236
- // showReactionTail parameter removed - tail shown automatically
237
175
);
238
176
```
239
177
240
178
> ⚠️ ** Important:**
241
- > The ` showReactionTail ` parameter has been completely removed. The reaction picker tail will always be shown when the reaction picker is visible, ensuring consistent behavior across your app.
242
-
243
- ### Summary of Changes:
244
-
245
- | Aspect | Previous | New Behavior |
246
- | ------------------------| -----------------------------------| ----------------------------------------------|
247
- | Tail Display Control | Manual (` showReactionTail ` ) | Automatic (always shown when picker visible) |
248
- | Parameter Required | Optional boolean parameter | Parameter removed |
249
- | Consistency | Could be inconsistent | Always consistent |
179
+ > The ` showReactionTail ` parameter is no longer supported. Tail is now always shown when the picker is visible.
250
180
251
181
---
252
182
253
- ✅ ** You're ready to migrate!**
254
- Ensure you test your application thoroughly after applying these changes.
183
+ ## 🎉 You're Ready to Migrate!
255
184
256
- ---
185
+ - ✅ Use ` StreamReactionPicker.builder ` or supply ` onReactionPicked `
186
+ - ✅ Convert all ` StreamMessageAction ` instances to type-safe generic usage
187
+ - ✅ Centralize handling with ` onCustomActionTap `
188
+ - ✅ Remove deprecated props like ` showReactionTail ` and ` messageTheme `
0 commit comments