You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Using with `showStreamAttachmentPickerModalBottomSheet`:**
109
+
```dart
110
+
final result = await showStreamAttachmentPickerModalBottomSheet(
111
+
context: context,
112
+
optionsBuilder: (context, defaultOptions) {
113
+
return [
114
+
...defaultOptions,
115
+
TabbedAttachmentPickerOption(
116
+
key: 'custom-option',
117
+
icon: const Icon(Icons.star),
118
+
supportedTypes: [AttachmentPickerType.images],
119
+
optionViewBuilder: (context, controller) {
120
+
return CustomPickerView();
121
+
},
122
+
),
123
+
];
124
+
},
125
+
);
126
+
```
127
+
128
+
> ⚠️ **Important:**
129
+
> - The builder pattern gives you access to default options, allowing more flexible customization
130
+
> - The builder works with both mobile (tabbed) and desktop (system) pickers
131
+
132
+
---
133
+
134
+
### 🛠 onCustomAttachmentPickerResult
135
+
136
+
#### Key Changes:
137
+
138
+
-`onCustomAttachmentPickerResult` has been removed. Use `onAttachmentPickerResult` which returns `FutureOr<bool>`.
139
+
- Result handler can now short-circuit default behavior by returning `true`.
140
+
141
+
#### Migration Steps:
142
+
143
+
**Before:**
144
+
```dart
145
+
StreamMessageInput(
146
+
onCustomAttachmentPickerResult: (result) {
147
+
if (result is CustomAttachmentPickerResult) {
148
+
final data = result.data;
149
+
// Handle custom result
150
+
}
151
+
},
152
+
)
153
+
```
154
+
155
+
**After:**
156
+
```dart
157
+
StreamMessageInput(
158
+
onAttachmentPickerResult: (result) {
159
+
if (result is CustomAttachmentPickerResult) {
160
+
final data = result.data;
161
+
// Handle custom result
162
+
return true; // Indicate we handled it - skips default processing
163
+
}
164
+
return false; // Let default handler process other result types
165
+
},
166
+
)
167
+
```
168
+
169
+
> ⚠️ **Important:**
170
+
> -`onAttachmentPickerResult` replaces `onCustomAttachmentPickerResult` and must return a boolean
171
+
> - Return `true` from `onAttachmentPickerResult` to skip default handling
172
+
> - Return `false` to allow the default handler to process the result
173
+
174
+
---
175
+
36
176
## 🧪 Migration for v10.0.0-beta.7
37
177
38
178
### 🛠 AttachmentFileUploader
@@ -610,6 +750,10 @@ StreamMessageWidget(
610
750
611
751
## 🎉 You're Ready to Migrate!
612
752
753
+
### For v10.0.0-beta.8:
754
+
- ✅ Replace `customAttachmentPickerOptions` with `attachmentPickerOptionsBuilder` to access and modify default options
755
+
- ✅ Replace `onCustomAttachmentPickerResult` with `onAttachmentPickerResult` that returns `FutureOr<bool>`
756
+
613
757
### For v10.0.0-beta.7:
614
758
- ✅ Update custom `AttachmentFileUploader` implementations to include the four new abstract methods: `uploadImage`, `uploadFile`, `removeImage`, and `removeFile`
615
759
- ✅ Update `MessageState` factory constructors to use `MessageDeleteScope` parameter
Copy file name to clipboardExpand all lines: packages/stream_chat_flutter/CHANGELOG.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,60 @@
1
+
## Upcoming Beta
2
+
3
+
🛑️ Breaking
4
+
5
+
-`onCustomAttachmentPickerResult` has been removed. Use `onAttachmentPickerResult` which returns `FutureOr<bool>` to indicate if the result was handled.
6
+
```dart
7
+
// Before
8
+
StreamMessageInput(
9
+
onCustomAttachmentPickerResult: (result) {
10
+
// Handle custom location attachment
11
+
final location = result.data['location'];
12
+
sendLocationMessage(location);
13
+
},
14
+
)
15
+
16
+
// After
17
+
StreamMessageInput(
18
+
onAttachmentPickerResult: (result) {
19
+
if (result is CustomAttachmentPickerResult) {
20
+
// Handle custom location attachment
21
+
final location = result.data['location'];
22
+
sendLocationMessage(location);
23
+
return true; // Skip default handling
24
+
}
25
+
return false; // Use default handling for built-in types
26
+
},
27
+
)
28
+
```
29
+
30
+
-`customAttachmentPickerOptions` has been removed. Use `attachmentPickerOptionsBuilder` to modify, reorder, or extend default options.
31
+
```dart
32
+
// Before - could only add custom options
33
+
StreamMessageInput(
34
+
customAttachmentPickerOptions: [
35
+
TabbedAttachmentPickerOption(
36
+
key: 'location',
37
+
icon: Icon(Icons.location_on),
38
+
// ...
39
+
),
40
+
],
41
+
)
42
+
43
+
// After - can now modify, filter, or extend default options
0 commit comments