rename Client to StreamChatClient
This commit is contained in:
@@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
/// Create a new instance of [Client] passing the apikey obtained from your
|
||||
/// Create a new instance of [StreamChatClient] passing the apikey obtained from your
|
||||
/// project dashboard.
|
||||
final client = Client('b67pax5b2wdq');
|
||||
final client = StreamChatClient('b67pax5b2wdq');
|
||||
|
||||
/// Set the current user. In a production scenario, this should be done using
|
||||
/// a backend to generate a user token using our server SDK.
|
||||
@@ -43,10 +43,10 @@ class StreamExample extends StatelessWidget {
|
||||
}) : super(key: key);
|
||||
|
||||
/// Instance of Stream Client.
|
||||
/// Stream's [Client] can be used to connect to our servers and set the default
|
||||
/// Stream's [StreamChatClient] can be used to connect to our servers and set the default
|
||||
/// user for the application. Performing these actions trigger a websocket connection
|
||||
/// allowing for real-time updates.
|
||||
final Client client;
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -287,8 +287,8 @@ class _MessageScreenState extends State<MessageScreen> {
|
||||
}
|
||||
|
||||
/// Extensions can be used to add functionality to the SDK. In the examples
|
||||
/// below, we add two simple extensions to the [Client] and [Channel].
|
||||
extension on Client {
|
||||
/// below, we add two simple extensions to the [StreamChatClient] and [Channel].
|
||||
extension on StreamChatClient {
|
||||
/// Fetches the current user id.
|
||||
String get uid => state.user.id;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class MessageSearchBlocState extends State<MessageSearchBloc>
|
||||
Stream<bool> get queryMessagesLoading =>
|
||||
_queryMessagesLoadingController.stream;
|
||||
|
||||
/// Calls [Client.search] updating [messageResponses] stream
|
||||
/// Calls [StreamChatClient.search] updating [messageResponses] stream
|
||||
Future<void> search({
|
||||
Map<String, dynamic> filter,
|
||||
Map<String, dynamic> messageFilter,
|
||||
@@ -82,7 +82,7 @@ class MessageSearchBlocState extends State<MessageSearchBloc>
|
||||
}
|
||||
}
|
||||
|
||||
/// Calls [Client.search] updating [queryMessagesLoading] stream
|
||||
/// Calls [StreamChatClient.search] updating [queryMessagesLoading] stream
|
||||
Future<void> loadMore({
|
||||
Map<String, dynamic> filter,
|
||||
Map<String, dynamic> messageFilter,
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'typedef.dart';
|
||||
///
|
||||
/// ```dart
|
||||
/// class MyApp extends StatelessWidget {
|
||||
/// final Client client;
|
||||
/// final StreamChatClient client;
|
||||
///
|
||||
/// MyApp(this.client);
|
||||
///
|
||||
@@ -50,7 +50,7 @@ class StreamChatCore extends StatefulWidget {
|
||||
|
||||
/// Instance of Stream Chat Client containing information about the current
|
||||
/// application.
|
||||
final Client client;
|
||||
final StreamChatClient client;
|
||||
|
||||
/// Widget descendant.
|
||||
final Widget child;
|
||||
@@ -85,7 +85,7 @@ class StreamChatCore extends StatefulWidget {
|
||||
class StreamChatCoreState extends State<StreamChatCore>
|
||||
with WidgetsBindingObserver {
|
||||
/// Initialized client used throughout the application.
|
||||
Client get client => widget.client;
|
||||
StreamChatClient get client => widget.client;
|
||||
|
||||
Timer _disconnectTimer;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stream_chat/stream_chat.dart';
|
||||
|
||||
class MockClient extends Mock implements Client {}
|
||||
class MockClient extends Mock implements StreamChatClient {}
|
||||
|
||||
class MockClientState extends Mock implements ClientState {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user