Merge branch 'develop' into overlay-portal

This commit is contained in:
Salvatore Giordano
2021-09-29 17:34:30 +02:00
82 changed files with 347 additions and 233 deletions
@@ -1,6 +1,8 @@
## Upcoming
## 3.0.0
⚠️ Deprecated
- Updated `stream_chat` dependency to [`3.0.0`](https://pub.dev/packages/stream_chat/changelog).
🛑️ Breaking Changes from `2.2.1`
- `MessageSearchListViewCore` `paginationParams` property is now deprecated in favor of `limit`.
```dart
@@ -10,7 +12,7 @@
// new
limit = 30
```
- `UserListViewCore` `pagination` property is now deprecated in favor of `limit`.
- `UserListCore` `pagination` property is now deprecated in favor of `limit`.
```dart
// previous
pagination = const PaginationParams(limit: 30)
@@ -18,7 +20,7 @@
// new
limit = 30
```
- `ChannelListViewCore` `pagination` property is now deprecated in favor of `limit`.
- `ChannelListCore` `pagination` property is now deprecated in favor of `limit`.
```dart
// previous
pagination = const PaginationParams(limit: 30)
@@ -27,9 +29,11 @@
limit = 30
```
- `UserListCore` `filter` property now is non-nullable.
🔄 Changed
- `UserListViewCore` filter property now has a default value.
- `UserListCore` filter property now has a default value.
```dart
filter = const Filter.empty()
```
@@ -56,7 +56,7 @@ import 'package:stream_chat_flutter_core/src/typedef.dart';
/// information about the channels.
class ChannelListCore extends StatefulWidget {
/// Instantiate a new ChannelListView
ChannelListCore({
const ChannelListCore({
Key? key,
required this.errorBuilder,
required this.emptyBuilder,
@@ -69,15 +69,9 @@ class ChannelListCore extends StatefulWidget {
this.memberLimit,
this.messageLimit,
this.sort,
@Deprecated(
"'pagination' is deprecated and shouldn't be used. "
"This property is no longer used, Please use 'limit' instead",
)
this.pagination,
this.channelListController,
int? limit,
}) : limit = limit ?? pagination?.limit ?? 25,
super(key: key);
this.limit = 25,
}) : super(key: key);
/// A [ChannelListController] allows reloading and pagination.
/// Use [ChannelListController.loadData] and
@@ -124,16 +118,6 @@ class ChannelListCore extends StatefulWidget {
/// Number of messages to fetch in each channel
final int? messageLimit;
/// Pagination parameters
/// limit: the number of channels to return (max is 30)
/// offset: the offset (max is 1000)
/// message_limit: how many messages should be included to each channel
@Deprecated(
"'pagination' is deprecated and shouldn't be used. "
"This property is no longer used, Please use 'limit' instead",
)
final PaginationParams? pagination;
/// The amount of channels requested per API call.
final int limit;
@@ -18,9 +18,9 @@ import 'package:stream_chat_flutter_core/src/typedef.dart';
/// Widget build(BuildContext context) {
/// return Scaffold(
/// body: MessageSearchListCore(
/// messageQuery: _messageFilter,
/// filters: _channelsFilter,
/// paginationParams: PaginationParams(limit: 20),
/// messageQuery: _messageFilter,
/// filters: _channelsFilter,
/// limit: 20,
/// ),
/// );
/// }
@@ -57,7 +57,7 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
/// [errorBuilder] must all be supplied and not null.
class UserListCore extends StatefulWidget {
/// Instantiate a new [UserListCore]
UserListCore({
const UserListCore({
required this.errorBuilder,
required this.emptyBuilder,
required this.loadingBuilder,
@@ -66,16 +66,10 @@ class UserListCore extends StatefulWidget {
this.filter = const Filter.empty(),
this.sort,
this.presence,
@Deprecated(
"'pagination' is deprecated and shouldn't be used. "
"This property is no longer used, Please use 'limit' instead",
)
this.pagination,
this.groupAlphabetically = false,
this.userListController,
int? limit,
}) : limit = limit ?? pagination?.limit ?? 30,
super(key: key);
this.limit = 30,
}) : super(key: key);
/// A [UserListController] allows reloading and pagination.
/// Use [UserListController.loadData] and [UserListController.paginateData]
@@ -97,8 +91,7 @@ class UserListCore extends StatefulWidget {
/// The query filters to use.
/// You can query on any of the custom fields you've defined on the [Channel].
/// You can also filter other built-in channel fields.
// TODO: Make it non-nullable in a future breaking release
final Filter? filter;
final Filter filter;
/// The sorting used for the channels matching the filters.
/// Sorting is based on field and direction, multiple sorting options can be
@@ -109,16 +102,6 @@ class UserListCore extends StatefulWidget {
/// If true youll receive user presence updates via the websocket events
final bool? presence;
/// Pagination parameters
/// limit: the number of users to return (max is 30)
/// offset: the offset (max is 1000)
/// message_limit: how many messages should be included to each channel
@Deprecated(
"'pagination' is deprecated and shouldn't be used. "
"This property is no longer used, Please use 'limit' instead",
)
final PaginationParams? pagination;
/// The amount of users requested per API call.
final int limit;
@@ -1,7 +1,7 @@
name: stream_chat_flutter_core
homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter.
version: 2.2.1
version: 3.0.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -16,7 +16,7 @@ dependencies:
sdk: flutter
meta: ^1.3.0
rxdart: ^0.27.0
stream_chat: ^2.2.1
stream_chat: ^3.0.0
dev_dependencies:
fake_async: ^1.2.0
@@ -129,7 +129,7 @@ void main() {
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) =>
Container(key: errorWidgetKey),
pagination: pagination,
limit: pagination.limit,
);
final mockClient = MockClient();
@@ -186,7 +186,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => Container(key: emptyWidgetKey),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: pagination.limit,
);
final mockClient = MockClient();
@@ -243,7 +243,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: pagination.limit,
);
final mockClient = MockClient();
@@ -306,7 +306,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: pagination.limit,
);
final mockClient = MockClient();
@@ -420,7 +420,7 @@ void main() {
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) =>
const Offstage(),
pagination: pagination.copyWith(limit: limit),
limit: limit,
);
final mockClient = MockClient();
@@ -516,7 +516,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: pagination.limit,
);
expect(channelListCore.limit, pagination.limit);
@@ -334,7 +334,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
paginationParams: pagination,
limit: pagination.limit,
filters: testFilter,
messageFilters: testMessageFilter,
);
@@ -457,7 +457,7 @@ void main() {
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) =>
const Offstage(),
paginationParams: pagination.copyWith(limit: limit),
limit: limit,
filters: testFilter,
messageFilters: testMessageFilter,
);
@@ -561,7 +561,7 @@ void main() {
errorBuilder: (BuildContext context, Object? error) => const Offstage(),
filters: testFilter,
messageFilters: testMessageFilter,
paginationParams: pagination,
limit: pagination.limit,
);
expect(messageSearchListCore.limit, pagination.limit);
@@ -341,7 +341,7 @@ void main() {
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: pagination.limit,
groupAlphabetically: true,
);
@@ -447,7 +447,7 @@ void main() {
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) =>
const Offstage(),
pagination: pagination.copyWith(limit: limit),
limit: limit,
groupAlphabetically: true,
);
@@ -522,15 +522,15 @@ void main() {
);
test('`widget.limit` should match `widget.pagination.limit`', () {
const pagination = PaginationParams(limit: 30);
const limit = 20;
final userListCore = UserListCore(
listBuilder: (_, __) => const Offstage(),
loadingBuilder: (BuildContext context) => const Offstage(),
emptyBuilder: (BuildContext context) => const Offstage(),
errorBuilder: (BuildContext context, Object error) => const Offstage(),
pagination: pagination,
limit: limit,
);
expect(userListCore.limit, pagination.limit);
expect(userListCore.limit, limit);
});
}