Skip to content

Commit 80870a8

Browse files
authored
release: changes for 8.0 release (#1984)
* changes for 8.0 release * added guide for migration to v8 * correct link for v8 migration guide * check correctly for no connectivity * fix tests accounting for connectivity plus
1 parent a621277 commit 80870a8

File tree

21 files changed

+137
-106
lines changed

21 files changed

+137
-106
lines changed

README.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,9 @@ This repository contains code for our [Dart](https://dart.dev/) and [Flutter](ht
1616

1717
Stream allows developers to rapidly deploy scalable feeds and chat messaging with an industry leading 99.999% uptime SLA guarantee.
1818

19-
**V4 Migration Guide**
20-
21-
> [!WARNING]
22-
> Flutter `> = v3.16.x` uses material 3 by default which breaks the UI of some of the components.
23-
> If you want to use these versions, you need to set the `useMaterial3` parameter to `false`
24-
> in the `ThemeData`.
25-
>
26-
> eg.
27-
>
28-
> ```dart
29-
> MaterialApp(
30-
> theme: ThemeData(
31-
> useMaterial3: false,
32-
> ),
33-
> ...
34-
> );
35-
> ```
36-
>
37-
> `StreamChat` widget overrides the `useMaterial3` parameter to `false` by default
38-
> so if you are using `StreamChat` widget, you **don't** need to set it manually.
39-
40-
For upgrading from V6 to V7, please refer to the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_7_0/)
19+
**V8 Migration Guide**
20+
21+
For upgrading from V7 to V8, please refer to the [V8 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_8_0/)
4122

4223
## Sample apps and demos
4324
Our team maintains a dedicated repository for full fledged sample applications and demos. Consider checking out [GetStream/flutter-samples](https://github.com/GetStream/flutter-samples) to learn more or get started by looking at our latest [Stream Chat demo](https://github.com/GetStream/flutter-samples/tree/main/packages/stream_chat_v1).
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
id: migration_guide_8_0
3+
title: v8.0
4+
slug: /guides/migration_guide_8_0/
5+
---
6+
7+
This guide enumerates and better explains the SDK changes introduced in v8.
8+
9+
If you find any bugs or have any questions, please file an [issue on our GitHub repository](https://github.com/GetStream/stream-chat-flutter/issues). We want to support you as much as we can with this migration.
10+
11+
Code examples:
12+
13+
- See our [Stream Chat Flutter tutorial](https://getstream.io/chat/flutter/tutorial/) for an up-to-date guide using the latest Stream Chat version.
14+
- See the [Stream Flutter Samples repository](https://github.com/GetStream/flutter-samples) with our full fledged messaging [sample application](https://github.com/GetStream/flutter-samples/tree/main/packages/stream_chat_v1).
15+
16+
Our documentation has also been updated to support v8, so all guides and examples will have updated code.
17+
18+
### Dependencies
19+
20+
To migrate to v8.0.0, update your `pubspec.yaml` with the correct Stream chat package you're using:
21+
22+
```yaml
23+
dependencies:
24+
stream_chat_flutter: ^8.0.0 # full UI, core and client packages
25+
stream_chat: ^8.0.0 # client package
26+
```
27+
28+
---
29+
30+
## Important notes
31+
32+
- The package from recent versions has been restricted to Flutter 3.19+ as we generally aim to support
33+
the latest and the previous version of Flutter when possible.
34+
35+
- The `attachmentBuilders` parameter in the `StreamMessageListView` now only expect custom attachments
36+
and does not need the default attachment builders. You can also use `StreamAttachmentWidgetBuilder.defaultBuilders`
37+
to add the default builders if necessary.
38+
39+
## Breaking changes
40+
41+
Version 8.0 has two main breaking changes.
42+
43+
### Removal of the `useMaterial3` flag
44+
45+
In v7, we introduced a temporary `useMaterial3` flag that allows users to optionally use Material3 styling in Stream components.
46+
This was necessary at the time for various reasons.
47+
48+
However, this flag is now removed and Material3 will be the default styling for all components.
49+
50+
### Connectivity stream changes
51+
52+
While this is a not directly a user-facing change, it is added here for completeness of the list.
53+
54+
The `StreamChat` widget has a `connectivityStream` parameter to allow testing of various scenarios.
55+
Due to changes in the relevant package, it was necessary to change the type of the stream from
56+
`Stream<ConnectivityResult>?` to `Stream<List<ConnectivityResult>>?`.
57+

packages/stream_chat_flutter/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

packages/stream_chat_flutter/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
97C146E61CF9000F007C117D /* Project object */ = {
156156
isa = PBXProject;
157157
attributes = {
158-
LastUpgradeCheck = 1430;
158+
LastUpgradeCheck = 1510;
159159
ORGANIZATIONNAME = "";
160160
TargetAttributes = {
161161
97C146ED1CF9000F007C117D = {
@@ -342,7 +342,7 @@
342342
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343343
GCC_WARN_UNUSED_FUNCTION = YES;
344344
GCC_WARN_UNUSED_VARIABLE = YES;
345-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
345+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
346346
MTL_ENABLE_DEBUG_INFO = NO;
347347
SDKROOT = iphoneos;
348348
SUPPORTED_PLATFORMS = iphoneos;
@@ -428,7 +428,7 @@
428428
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
429429
GCC_WARN_UNUSED_FUNCTION = YES;
430430
GCC_WARN_UNUSED_VARIABLE = YES;
431-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
431+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
432432
MTL_ENABLE_DEBUG_INFO = YES;
433433
ONLY_ACTIVE_ARCH = YES;
434434
SDKROOT = iphoneos;
@@ -477,7 +477,7 @@
477477
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
478478
GCC_WARN_UNUSED_FUNCTION = YES;
479479
GCC_WARN_UNUSED_VARIABLE = YES;
480-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
480+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
481481
MTL_ENABLE_DEBUG_INFO = NO;
482482
SDKROOT = iphoneos;
483483
SUPPORTED_PLATFORMS = iphoneos;

packages/stream_chat_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

packages/stream_chat_flutter/lib/src/gallery/gallery_footer.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class _StreamGalleryFooterState extends State<StreamGalleryFooter> {
7474
context: context,
7575
removeTop: true,
7676
child: BottomAppBar(
77+
surfaceTintColor:
78+
widget.backgroundColor ?? galleryFooterThemeData.backgroundColor,
7779
color:
7880
widget.backgroundColor ?? galleryFooterThemeData.backgroundColor,
7981
child: Row(

packages/stream_chat_flutter/lib/src/gallery/gallery_header.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class StreamGalleryHeader extends StatelessWidget
9595
onPressed: onBackPressed,
9696
)
9797
: const SizedBox(),
98+
surfaceTintColor:
99+
backgroundColor ?? galleryHeaderThemeData.backgroundColor,
98100
backgroundColor:
99101
backgroundColor ?? galleryHeaderThemeData.backgroundColor,
100102
actions: <Widget>[

packages/stream_chat_flutter/lib/src/stream_chat.dart

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class StreamChat extends StatefulWidget {
3939
this.onBackgroundEventReceived,
4040
this.backgroundKeepAlive = const Duration(minutes: 1),
4141
this.connectivityStream,
42-
this.useMaterial3 = false,
4342
});
4443

4544
/// Client to do chat operations with
@@ -66,11 +65,7 @@ class StreamChat extends StatefulWidget {
6665
/// Stream of connectivity result
6766
/// Visible for testing
6867
@visibleForTesting
69-
final Stream<ConnectivityResult>? connectivityStream;
70-
71-
/// Whether to use material 3 or not (default is false)
72-
/// See our [docs](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_chat_and_theming)
73-
final bool useMaterial3;
68+
final Stream<List<ConnectivityResult>>? connectivityStream;
7469

7570
@override
7671
StreamChatState createState() => StreamChatState();
@@ -112,46 +107,40 @@ class StreamChatState extends State<StreamChat> {
112107
@override
113108
Widget build(BuildContext context) {
114109
final theme = _getTheme(context, widget.streamChatThemeData);
115-
return Theme(
116-
data: Theme.of(context).copyWith(
117-
// ignore: deprecated_member_use
118-
useMaterial3: widget.useMaterial3,
119-
),
120-
child: Portal(
121-
child: StreamChatConfiguration(
122-
data: streamChatConfigData,
123-
child: StreamChatTheme(
124-
data: theme,
125-
child: Builder(
126-
builder: (context) {
127-
final materialTheme = Theme.of(context);
128-
final streamTheme = StreamChatTheme.of(context);
129-
return Theme(
130-
data: materialTheme.copyWith(
131-
primaryIconTheme: streamTheme.primaryIconTheme,
132-
colorScheme: materialTheme.colorScheme.copyWith(
133-
secondary: streamTheme.colorTheme.accentPrimary,
134-
),
110+
return Portal(
111+
child: StreamChatConfiguration(
112+
data: streamChatConfigData,
113+
child: StreamChatTheme(
114+
data: theme,
115+
child: Builder(
116+
builder: (context) {
117+
final materialTheme = Theme.of(context);
118+
final streamTheme = StreamChatTheme.of(context);
119+
return Theme(
120+
data: materialTheme.copyWith(
121+
primaryIconTheme: streamTheme.primaryIconTheme,
122+
colorScheme: materialTheme.colorScheme.copyWith(
123+
secondary: streamTheme.colorTheme.accentPrimary,
135124
),
136-
child: StreamChatCore(
137-
client: client,
138-
onBackgroundEventReceived: widget.onBackgroundEventReceived,
139-
backgroundKeepAlive: widget.backgroundKeepAlive,
140-
connectivityStream: widget.connectivityStream,
141-
child: Builder(
142-
builder: (context) {
143-
StreamChatClient.additionalHeaders = {
144-
'X-Stream-Client':
145-
'${StreamChatClient.defaultUserAgent}-'
146-
'ui-${StreamChatClient.packageVersion}',
147-
};
148-
return widget.child ?? const Offstage();
149-
},
150-
),
125+
),
126+
child: StreamChatCore(
127+
client: client,
128+
onBackgroundEventReceived: widget.onBackgroundEventReceived,
129+
backgroundKeepAlive: widget.backgroundKeepAlive,
130+
connectivityStream: widget.connectivityStream,
131+
child: Builder(
132+
builder: (context) {
133+
StreamChatClient.additionalHeaders = {
134+
'X-Stream-Client':
135+
'${StreamChatClient.defaultUserAgent}-'
136+
'ui-${StreamChatClient.packageVersion}',
137+
};
138+
return widget.child ?? const Offstage();
139+
},
151140
),
152-
);
153-
},
154-
),
141+
),
142+
);
143+
},
155144
),
156145
),
157146
),

packages/stream_chat_flutter/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ dependencies:
3131
image_size_getter: ^2.1.3
3232
jiffy: ^6.2.1
3333
just_audio: ^0.9.38
34-
lottie: ">=2.6.0 <4.0.0"
34+
lottie: ^3.1.2
3535
media_kit: ^1.1.10+1
3636
media_kit_video: ^1.2.4
3737
meta: ^1.9.1
3838
path_provider: ^2.1.3
3939
photo_manager: ^3.2.0
4040
photo_view: ^0.15.0
4141
rxdart: ^0.27.7
42-
share_plus: ">=8.0.2 <10.0.0"
42+
share_plus: ^8.0.3
4343
shimmer: ^3.0.0
4444
stream_chat_flutter_core: ^7.3.0
4545
synchronized: ^3.1.0+1

packages/stream_chat_flutter/test/src/avatars/group_avatar_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main() {
5050
.instance.defaultBinaryMessenger
5151
.handlePlatformMessage(
5252
methodChannel.name,
53-
methodChannel.codec.encodeSuccessEnvelope('wifi'),
53+
methodChannel.codec.encodeSuccessEnvelope(['wifi']),
5454
(_) {},
5555
);
5656
} catch (e) {

packages/stream_chat_flutter/test/src/bottom_sheets/edit_message_sheet_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
.instance.defaultBinaryMessenger
2222
.handlePlatformMessage(
2323
methodChannel.name,
24-
methodChannel.codec.encodeSuccessEnvelope('wifi'),
24+
methodChannel.codec.encodeSuccessEnvelope(['wifi']),
2525
(_) {},
2626
);
2727
} catch (e) {

packages/stream_chat_flutter/test/src/bottom_sheets/error_alert_sheet_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
.instance.defaultBinaryMessenger
2222
.handlePlatformMessage(
2323
methodChannel.name,
24-
methodChannel.codec.encodeSuccessEnvelope('wifi'),
24+
methodChannel.codec.encodeSuccessEnvelope(['wifi']),
2525
(_) {},
2626
);
2727
} catch (e) {

packages/stream_chat_flutter/test/src/gallery/gallery_footer_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void main() {
4949
.instance.defaultBinaryMessenger
5050
.handlePlatformMessage(
5151
methodChannel.name,
52-
methodChannel.codec.encodeSuccessEnvelope('wifi'),
52+
methodChannel.codec.encodeSuccessEnvelope(['wifi']),
5353
(_) {},
5454
);
5555
} catch (e) {

packages/stream_chat_flutter/test/src/gallery/gallery_header_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void main() {
4949
.instance.defaultBinaryMessenger
5050
.handlePlatformMessage(
5151
methodChannel.name,
52-
methodChannel.codec.encodeSuccessEnvelope('wifi'),
52+
methodChannel.codec.encodeSuccessEnvelope(['wifi']),
5353
(_) {},
5454
);
5555
} catch (e) {

packages/stream_chat_flutter/test/src/message_widget/deleted_message_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void main() {
7575
StreamChat(
7676
streamChatThemeData: theme,
7777
client: client,
78-
connectivityStream: Stream.value(ConnectivityResult.mobile),
78+
connectivityStream: Stream.value([ConnectivityResult.mobile]),
7979
child: StreamChannel(
8080
showLoading: false,
8181
channel: channel,
@@ -136,7 +136,7 @@ void main() {
136136
home: StreamChat(
137137
streamChatThemeData: theme,
138138
client: client,
139-
connectivityStream: Stream.value(ConnectivityResult.mobile),
139+
connectivityStream: Stream.value([ConnectivityResult.mobile]),
140140
child: StreamChannel(
141141
showLoading: false,
142142
channel: channel,
@@ -194,7 +194,7 @@ void main() {
194194
home: StreamChat(
195195
streamChatThemeData: theme,
196196
client: client,
197-
connectivityStream: Stream.value(ConnectivityResult.mobile),
197+
connectivityStream: Stream.value([ConnectivityResult.mobile]),
198198
child: StreamChannel(
199199
showLoading: false,
200200
channel: channel,

packages/stream_chat_flutter/test/src/message_widget/message_text_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ cool.''';
221221
home: SimpleFrame(
222222
child: StreamChat(
223223
client: client,
224-
connectivityStream: Stream.value(ConnectivityResult.wifi),
224+
connectivityStream: Stream.value([ConnectivityResult.wifi]),
225225
child: StreamChannel(
226226
channel: channel,
227227
child: Scaffold(

0 commit comments

Comments
 (0)