rename Client to StreamChatClient

This commit is contained in:
Salvatore Giordano
2021-02-01 15:30:46 +01:00
parent 1751cd6092
commit 23feabe85e
33 changed files with 185 additions and 176 deletions
@@ -267,7 +267,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
),
);
final client = Client(
final client = StreamChatClient(
apiKey,
logLevel: Level.INFO,
)..chatPersistenceClient = chatPersistentClient;
@@ -15,7 +15,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// you can use [StreamChat.of], [StreamChannel.of] and [StreamChatTheme.of] to use the API client directly
/// or to retrieve outer scope needed such as messages from the [Channel.state].
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -29,7 +29,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -19,7 +19,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// We also change the message color posted by the current user.
/// You can perform these more granular style changes using [StreamChatTheme.copyWith].
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -33,7 +33,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -20,7 +20,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
///
/// - We retrieve the count of unread messages from [Channel.state]
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -34,7 +34,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -15,7 +15,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// you can use [StreamChat.of], [StreamChannel.of] and [StreamChatTheme.of] to use the API client directly
/// or to retrieve outer scope needed such as messages from the [Channel.state].
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -29,7 +29,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -29,7 +29,7 @@ void main() async {
final apiKey = await secureStorage.read(key: kStreamApiKey);
final userId = await secureStorage.read(key: kStreamUserId);
final client = Client(
final client = StreamChatClient(
apiKey ?? kDefaultStreamApiKey,
logLevel: Level.INFO,
)..chatPersistenceClient = chatPersistentClient;
@@ -46,7 +46,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -19,7 +19,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
/// In this case we are showing the list of channels the current user is a member and we order them based on the time they had a new message.
/// [ChannelListView] handles pagination and updates automatically out of the box when new channels are created or when a new message is added to a channel.
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -33,7 +33,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -5,8 +5,8 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
///
/// There are three important things to notice that are common to all Flutter application using StreamChat:
///
/// 1. The Dart API [Client] is initialized with your API Key
/// 2. The current user is set by calling [Client.setUser]
/// 1. The Dart API [StreamChatClient] is initialized with your API Key
/// 2. The current user is set by calling [StreamChatClient.setUser]
/// 3. The client is then passed to the top-level [StreamChat] widget
/// [StreamChat] is an inherited widget and must be the parent of all Chat related widgets.
///
@@ -15,9 +15,9 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
///
/// Let's have a look at what we've built:
///
/// - We set up the Chat [Client] with the API key
/// - We set up the Chat [StreamChatClient] with the API key
///
/// - We set the the current user for Chat with [Client.setUser] and a pre-generated user token
/// - We set the the current user for Chat with [StreamChatClient.setUser] and a pre-generated user token
///
/// - We make [StreamChat] the root Widget of our application
///
@@ -25,7 +25,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
///
/// If you now run the simulator you will see a single channel UI.
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -44,7 +44,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
final Channel channel;
MyApp(this.client, this.channel);
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -16,7 +16,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);
@@ -10,7 +10,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
///
/// Now we can open threads and create new ones as well, if you long press a message you can tap on Reply and it will open the same [ThreadPage].
void main() async {
final client = Client(
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
@@ -24,7 +24,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
final Client client;
final StreamChatClient client;
MyApp(this.client);