Skip to content

Commit 76debfd

Browse files
authored
chore(repo): update migration guide
1 parent 5a2dc40 commit 76debfd

File tree

1 file changed

+49
-117
lines changed

1 file changed

+49
-117
lines changed

migrations/v10-migration.md

Lines changed: 49 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 🚀 Flutter SDK v10.0 Migration Guide
1+
# 🚀 Flutter SDK v10 Migration Guide
22

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.
44

55
---
66

@@ -10,26 +10,24 @@ This guide includes breaking changes grouped by release phase:
1010

1111
### 🚧 v10.0.0-beta.1
1212

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)
1717

1818
---
1919

2020
## 🧪 Migration for v10.0.0-beta.1
2121

22-
### 🛠 StreamReactionPicker Refactor
22+
### 🛠 StreamReactionPicker
2323

24-
The reaction picker has been refactored for modularity, flexibility, and explicit reaction handling.
24+
#### Key Changes:
2525

26-
### Key Changes:
27-
**Key Changes:**
2826
- New `StreamReactionPicker.builder` constructor
2927
- Added properties: `padding`, `scrollable`, `borderRadius`
30-
- Removed automatic reaction handling use `onReactionPicked`
28+
- Automatic reaction handling removed — must now use `onReactionPicked`
3129

32-
### Migration Steps:
30+
#### Migration Steps:
3331

3432
**Before:**
3533
```dart
@@ -38,24 +36,24 @@ StreamReactionPicker(
3836
);
3937
```
4038

41-
**After (Recommended using Builder):**
39+
**After (Recommended Builder):**
4240
```dart
4341
StreamReactionPicker.builder(
4442
context,
4543
message,
4644
(Reaction reaction) {
47-
// Explicitly handle reaction here
45+
// Explicitly handle reaction
4846
},
4947
);
5048
```
5149

52-
**After (Alternative Direct Configuration):**
50+
**After (Alternative Direct Configuration):**
5351
```dart
5452
StreamReactionPicker(
5553
message: message,
5654
reactionIcons: StreamChatConfiguration.of(context).reactionIcons,
5755
onReactionPicked: (Reaction reaction) {
58-
// Explicit reaction handling
56+
// Handle reaction here
5957
},
6058
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
6159
scrollable: true,
@@ -64,51 +62,32 @@ StreamReactionPicker(
6462
```
6563

6664
> ⚠️ **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`.
7666
7767
---
7868

79-
## StreamMessageAction Refactor
69+
### 🛠 StreamMessageAction
8070

81-
The `StreamMessageAction` is refactored for type safety, centralization, and enhanced customization.
71+
#### Key Changes:
8272

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
9276

93-
### Migration Steps:
77+
#### Migration Steps:
9478

9579
**Before:**
9680
```dart
9781
final customAction = StreamMessageAction(
9882
title: Text('Custom Action'),
9983
leading: Icon(Icons.settings),
100-
onTap: (Message message) {
84+
onTap: (message) {
10185
// Handle action
10286
},
10387
);
104-
105-
StreamMessageWidget(
106-
message: message,
107-
customActions: [customAction],
108-
);
10988
```
11089

111-
**After (Recommended - Type-safe):**
90+
**After (Type-safe):**
11291
```dart
11392
final customAction = StreamMessageAction<CustomMessageAction>(
11493
action: CustomMessageAction(
@@ -125,132 +104,85 @@ StreamMessageWidget(
125104
message: message,
126105
customActions: [customAction],
127106
onCustomActionTap: (CustomMessageAction action) {
128-
// Handle action based on extraData
107+
// Handle action here
129108
},
130109
);
131110
```
132111

133112
> ⚠️ **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`.
143114
144115
---
145116

146-
## StreamMessageReactionsModal Refactor
117+
### 🛠 StreamMessageReactionsModal
147118

148-
Refactored to leverage `StreamMessageModal`, improving consistency and explicit reaction handling.
119+
#### Key Changes:
149120

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`
154124

155-
### Migration Steps:
125+
#### Migration Steps:
156126

157-
**Step 1: Remove `messageTheme`:**
127+
**Before:**
158128
```dart
159-
// Before
160-
StreamMessageReactionsModal(
161-
message: message,
162-
messageWidget: myMessageWidget,
163-
messageTheme: myCustomMessageTheme, // remove this
164-
reverse: true,
165-
);
166-
167-
// After
168129
StreamMessageReactionsModal(
169130
message: message,
170131
messageWidget: myMessageWidget,
132+
messageTheme: myCustomMessageTheme,
171133
reverse: true,
172134
);
173135
```
174136

175-
**Step 2: Explicit Reaction Handling:**
137+
**After:**
176138
```dart
177-
// Before (automatic handling)
178-
StreamMessageReactionsModal(
179-
message: message,
180-
messageWidget: myMessageWidget,
181-
// reactions handled internally
182-
);
183-
184-
// After (explicit handling)
185139
StreamMessageReactionsModal(
186140
message: message,
187141
messageWidget: myMessageWidget,
142+
reverse: true,
188143
onReactionPicked: (SelectReaction reactionAction) {
189-
// Explicitly send or delete reaction
144+
// Handle reaction explicitly
190145
},
191146
);
192147
```
193148

194149
> ⚠️ **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`.
204151
205152
---
206153

207-
## StreamMessageWidget Refactor
154+
### 🛠 StreamMessageWidget
208155

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:
210157

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
214160

215-
### Migration Steps:
161+
#### Migration Steps:
216162

217163
**Before:**
218164
```dart
219165
StreamMessageWidget(
220166
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,
229168
);
230169
```
231170

232171
**After:**
233172
```dart
234173
StreamMessageWidget(
235174
message: message,
236-
// showReactionTail parameter removed - tail shown automatically
237175
);
238176
```
239177

240178
> ⚠️ **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.
250180
251181
---
252182

253-
**You're ready to migrate!**
254-
Ensure you test your application thoroughly after applying these changes.
183+
## 🎉 You're Ready to Migrate!
255184

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

Comments
 (0)