removed deprecated uses, fmt
This commit is contained in:
@@ -6,7 +6,8 @@ class ImagePickerImpl extends ImagePickerRepository {
|
||||
@override
|
||||
Future<File> pickImage() async {
|
||||
final picker = ImagePicker();
|
||||
final pickedFile = await picker.getImage(source: ImageSource.gallery, maxWidth: 400);
|
||||
final pickedFile =
|
||||
await picker.getImage(source: ImageSource.gallery, maxWidth: 400);
|
||||
return File(pickedFile.path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,9 @@ class StreamApiLocalImpl extends StreamApiRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Channel> createGroupChat(String channelId, String name, List<String> members, {String image}) async {
|
||||
Future<Channel> createGroupChat(
|
||||
String channelId, String name, List<String> members,
|
||||
{String image}) async {
|
||||
final channel = _client.channel('messaging', id: channelId, extraData: {
|
||||
'name': name,
|
||||
'image': image,
|
||||
@@ -58,13 +60,14 @@ class StreamApiLocalImpl extends StreamApiRepository {
|
||||
|
||||
@override
|
||||
Future<Channel> createSimpleChat(String friendId) async {
|
||||
final channel =
|
||||
_client.channel('messaging', id: '${_client.state.user.id.hashCode}${friendId.hashCode}', extraData: {
|
||||
'members': [
|
||||
friendId,
|
||||
_client.state.user.id,
|
||||
],
|
||||
});
|
||||
final channel = _client.channel('messaging',
|
||||
id: '${_client.state.user.id.hashCode}${friendId.hashCode}',
|
||||
extraData: {
|
||||
'members': [
|
||||
friendId,
|
||||
_client.state.user.id,
|
||||
],
|
||||
});
|
||||
await channel.watch();
|
||||
return channel;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,10 @@ class AuthImpl extends AuthRepository {
|
||||
try {
|
||||
UserCredential userCredential;
|
||||
final GoogleSignInAccount googleUser = await GoogleSignIn().signIn();
|
||||
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
|
||||
final GoogleAuthCredential googleAuthCredential = GoogleAuthProvider.credential(
|
||||
final GoogleSignInAuthentication googleAuth =
|
||||
await googleUser.authentication;
|
||||
final GoogleAuthCredential googleAuthCredential =
|
||||
GoogleAuthProvider.credential(
|
||||
accessToken: googleAuth.accessToken,
|
||||
idToken: googleAuth.idToken,
|
||||
);
|
||||
|
||||
@@ -62,7 +62,8 @@ class StreamApiImpl extends StreamApiRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Channel> createGroupChat(String id, String name, List<String> members, {String image}) async {
|
||||
Future<Channel> createGroupChat(String id, String name, List<String> members,
|
||||
{String image}) async {
|
||||
final channel = _client.channel('messaging', id: id, extraData: {
|
||||
'name': name,
|
||||
'image': image,
|
||||
@@ -74,13 +75,14 @@ class StreamApiImpl extends StreamApiRepository {
|
||||
|
||||
@override
|
||||
Future<Channel> createSimpleChat(String friendId) async {
|
||||
final channel =
|
||||
_client.channel('messaging', id: '${_client.state.user.id.hashCode}${friendId.hashCode}', extraData: {
|
||||
'members': [
|
||||
friendId,
|
||||
_client.state.user.id,
|
||||
],
|
||||
});
|
||||
final channel = _client.channel('messaging',
|
||||
id: '${_client.state.user.id.hashCode}${friendId.hashCode}',
|
||||
extraData: {
|
||||
'members': [
|
||||
friendId,
|
||||
_client.state.user.id,
|
||||
],
|
||||
});
|
||||
await channel.watch();
|
||||
return channel;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ abstract class StreamApiRepository {
|
||||
Future<String> getToken(String userId);
|
||||
Future<bool> connectIfExist(String userId);
|
||||
Future<ChatUser> connectUser(ChatUser user, String token);
|
||||
Future<Channel> createGroupChat(String channelId, String name, List<String> members, {String image});
|
||||
Future<Channel> createGroupChat(
|
||||
String channelId, String name, List<String> members,
|
||||
{String image});
|
||||
Future<Channel> createSimpleChat(String friendId);
|
||||
Future<void> logout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user