update dependencies
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## 0.2.0-alpha+6
|
## 0.2.0-alpha+7
|
||||||
|
|
||||||
- Update llc dependency
|
- Update llc dependency
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
/// The widget uses a [StreamBuilder] to render the channel information image as soon as it updates.
|
/// The widget uses a [StreamBuilder] to render the channel information image as soon as it updates.
|
||||||
///
|
///
|
||||||
/// By default the widget radius size is 40x40 pixels.
|
/// By default the widget radius size is 40x40 pixels.
|
||||||
/// Set the property [size] to set a custom dimension.
|
/// Set the property [constraints] to set a custom dimension.
|
||||||
///
|
///
|
||||||
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
||||||
/// Modify it to change the widget appearance.
|
/// Modify it to change the widget appearance.
|
||||||
@@ -47,38 +47,49 @@ class ChannelImage extends StatelessWidget {
|
|||||||
const ChannelImage({
|
const ChannelImage({
|
||||||
Key key,
|
Key key,
|
||||||
this.channel,
|
this.channel,
|
||||||
this.size = 40,
|
this.constraints,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// The channel to show the image of
|
/// The channel to show the image of
|
||||||
final Channel channel;
|
final Channel channel;
|
||||||
|
|
||||||
/// The diameter of the image
|
/// The diameter of the image
|
||||||
final double size;
|
final BoxConstraints constraints;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final client = StreamChat.of(context);
|
||||||
final channel = this.channel ?? StreamChannel.of(context).channel;
|
final channel = this.channel ?? StreamChannel.of(context).channel;
|
||||||
return StreamBuilder<Map<String, dynamic>>(
|
return StreamBuilder<Map<String, dynamic>>(
|
||||||
stream: channel.extraDataStream,
|
stream: channel.extraDataStream,
|
||||||
initialData: channel.extraData,
|
initialData: channel.extraData,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
String image;
|
||||||
|
if (snapshot.data?.containsKey('image') == true) {
|
||||||
|
image = snapshot.data['image'];
|
||||||
|
} else if (channel.state.members.length == 2) {
|
||||||
|
final otherMember = channel.state.members
|
||||||
|
.firstWhere((member) => member.user.id != client.user.id);
|
||||||
|
image = otherMember.user.extraData['image'];
|
||||||
|
}
|
||||||
|
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: StreamChatTheme.of(context)
|
borderRadius: StreamChatTheme.of(context)
|
||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
.avatarTheme
|
.avatarTheme
|
||||||
.borderRadius,
|
.borderRadius,
|
||||||
child: Container(
|
child: Container(
|
||||||
constraints: StreamChatTheme.of(context)
|
constraints: constraints ??
|
||||||
.channelPreviewTheme
|
StreamChatTheme.of(context)
|
||||||
.avatarTheme
|
.channelPreviewTheme
|
||||||
.constraints,
|
.avatarTheme
|
||||||
|
.constraints,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: StreamChatTheme.of(context).accentColor,
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
),
|
),
|
||||||
child: snapshot.data?.containsKey('image') ?? false
|
child: image != null
|
||||||
? CachedNetworkImage(
|
? CachedNetworkImage(
|
||||||
imageUrl: snapshot.data['image'],
|
imageUrl: image,
|
||||||
errorWidget: (_, __, ___) {
|
errorWidget: (_, __, ___) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat/stream_chat.dart';
|
import 'package:stream_chat/stream_chat.dart';
|
||||||
|
|
||||||
|
import '../stream_chat_flutter.dart';
|
||||||
import 'stream_channel.dart';
|
import 'stream_channel.dart';
|
||||||
|
|
||||||
/// It shows the current [Channel] name using a [Text] widget.
|
/// It shows the current [Channel] name using a [Text] widget.
|
||||||
@@ -22,15 +23,24 @@ class ChannelName extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final client = StreamChat.of(context);
|
||||||
final channel = this.channel ?? StreamChannel.of(context).channel;
|
final channel = this.channel ?? StreamChannel.of(context).channel;
|
||||||
return StreamBuilder<Map<String, dynamic>>(
|
return StreamBuilder<Map<String, dynamic>>(
|
||||||
stream: channel.extraDataStream,
|
stream: channel.extraDataStream,
|
||||||
initialData: channel.extraData,
|
initialData: channel.extraData,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
String title;
|
||||||
|
if (snapshot.data['name'] == null &&
|
||||||
|
channel.state.members.length == 2) {
|
||||||
|
final otherMember = channel.state.members
|
||||||
|
.firstWhere((member) => member.user.id != client.user.id);
|
||||||
|
title = otherMember.user.name;
|
||||||
|
} else {
|
||||||
|
title = snapshot.data['name'] ?? channel.id;
|
||||||
|
}
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
snapshot.data != null
|
title,
|
||||||
? (snapshot.data['name'] ?? channel.cid)
|
|
||||||
: channel.cid,
|
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
+14
-14
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
@@ -765,7 +766,7 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int _keyboardListener;
|
StreamSubscription _keyboardListener;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -773,16 +774,8 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
|
|
||||||
StreamChannel.of(context).queryMembersAndWatchers();
|
StreamChannel.of(context).queryMembersAndWatchers();
|
||||||
|
|
||||||
_keyboardListener = KeyboardVisibilityNotification().addNewListener(
|
_keyboardListener = KeyboardVisibility.onChange.listen((visible) {
|
||||||
onHide: () {
|
if (visible) {
|
||||||
if (_commandsOverlay != null) {
|
|
||||||
_commandsOverlay.remove();
|
|
||||||
}
|
|
||||||
if (_mentionsOverlay != null) {
|
|
||||||
_mentionsOverlay.remove();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onShow: () {
|
|
||||||
if (_commandsOverlay != null) {
|
if (_commandsOverlay != null) {
|
||||||
if (_textController.text.startsWith('/')) {
|
if (_textController.text.startsWith('/')) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
@@ -800,8 +793,15 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
);
|
if (_commandsOverlay != null) {
|
||||||
|
_commandsOverlay.remove();
|
||||||
|
}
|
||||||
|
if (_mentionsOverlay != null) {
|
||||||
|
_mentionsOverlay.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (widget.editMessage != null) {
|
if (widget.editMessage != null) {
|
||||||
_textController = TextEditingController(text: widget.editMessage.text);
|
_textController = TextEditingController(text: widget.editMessage.text);
|
||||||
@@ -842,7 +842,7 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
_commandsOverlay?.remove();
|
_commandsOverlay?.remove();
|
||||||
_mentionsOverlay?.remove();
|
_mentionsOverlay?.remove();
|
||||||
KeyboardVisibilityNotification().removeListener(_keyboardListener);
|
_keyboardListener.cancel();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
|
|||||||
createdAt: channel.createdAt,
|
createdAt: channel.createdAt,
|
||||||
extraData: channel.extraData,
|
extraData: channel.extraData,
|
||||||
type: channel.type,
|
type: channel.type,
|
||||||
members: channel.state.members,
|
|
||||||
memberCount: channel.memberCount,
|
memberCount: channel.memberCount,
|
||||||
frozen: channel.frozen,
|
frozen: channel.frozen,
|
||||||
cid: channel.cid,
|
cid: channel.cid,
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ class UserAvatar extends StatelessWidget {
|
|||||||
const UserAvatar({
|
const UserAvatar({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.user,
|
@required this.user,
|
||||||
this.radius = 16,
|
this.constraints,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final User user;
|
final User user;
|
||||||
final double radius;
|
final BoxConstraints constraints;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -20,7 +20,7 @@ class UserAvatar extends StatelessWidget {
|
|||||||
borderRadius:
|
borderRadius:
|
||||||
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.borderRadius,
|
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.borderRadius,
|
||||||
child: Container(
|
child: Container(
|
||||||
constraints:
|
constraints: constraints ??
|
||||||
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints,
|
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: StreamChatTheme.of(context).accentColor,
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
|
|||||||
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
name: stream_chat_flutter
|
name: stream_chat_flutter
|
||||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||||
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
||||||
version: 0.2.0-alpha+6
|
version: 0.2.0-alpha+7
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.3.0 <3.0.0"
|
sdk: ">=2.3.0 <3.0.0"
|
||||||
@@ -10,17 +10,17 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
photo_view: ^0.9.2
|
photo_view: ^0.9.2
|
||||||
|
rxdart: ^0.24.0
|
||||||
jiffy: ^3.0.1
|
jiffy: ^3.0.1
|
||||||
cached_network_image: ^2.1.0+1
|
cached_network_image: ^2.1.0+1
|
||||||
flutter_markdown: ^0.3.4
|
flutter_markdown: ^0.3.5
|
||||||
url_launcher: ^5.4.2
|
url_launcher: ^5.4.2
|
||||||
video_player: ^0.10.8+1
|
video_player: ^0.10.8+1
|
||||||
chewie: ^0.9.10
|
chewie: ^0.9.10
|
||||||
rxdart: ^0.23.0
|
file_picker: ^1.6.3+2
|
||||||
file_picker: ^1.6.2
|
|
||||||
image_picker: ^0.6.5
|
image_picker: ^0.6.5
|
||||||
flutter_keyboard_visibility: ^0.8.0
|
flutter_keyboard_visibility: ^2.0.0
|
||||||
stream_chat: ^0.2.0-alpha+4
|
stream_chat: ^0.2.0-alpha+5
|
||||||
mime: ^0.9.6+3
|
mime: ^0.9.6+3
|
||||||
visibility_detector: ^0.1.4
|
visibility_detector: ^0.1.4
|
||||||
http_parser: ^3.1.4
|
http_parser: ^3.1.4
|
||||||
|
|||||||
Reference in New Issue
Block a user