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
|
||||
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
/// 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].
|
||||
/// Modify it to change the widget appearance.
|
||||
@@ -47,38 +47,49 @@ class ChannelImage extends StatelessWidget {
|
||||
const ChannelImage({
|
||||
Key key,
|
||||
this.channel,
|
||||
this.size = 40,
|
||||
this.constraints,
|
||||
}) : super(key: key);
|
||||
|
||||
/// The channel to show the image of
|
||||
final Channel channel;
|
||||
|
||||
/// The diameter of the image
|
||||
final double size;
|
||||
final BoxConstraints constraints;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final client = StreamChat.of(context);
|
||||
final channel = this.channel ?? StreamChannel.of(context).channel;
|
||||
return StreamBuilder<Map<String, dynamic>>(
|
||||
stream: channel.extraDataStream,
|
||||
initialData: channel.extraData,
|
||||
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(
|
||||
borderRadius: StreamChatTheme.of(context)
|
||||
.channelPreviewTheme
|
||||
.avatarTheme
|
||||
.borderRadius,
|
||||
child: Container(
|
||||
constraints: StreamChatTheme.of(context)
|
||||
.channelPreviewTheme
|
||||
.avatarTheme
|
||||
.constraints,
|
||||
constraints: constraints ??
|
||||
StreamChatTheme.of(context)
|
||||
.channelPreviewTheme
|
||||
.avatarTheme
|
||||
.constraints,
|
||||
decoration: BoxDecoration(
|
||||
color: StreamChatTheme.of(context).accentColor,
|
||||
),
|
||||
child: snapshot.data?.containsKey('image') ?? false
|
||||
child: image != null
|
||||
? CachedNetworkImage(
|
||||
imageUrl: snapshot.data['image'],
|
||||
imageUrl: image,
|
||||
errorWidget: (_, __, ___) {
|
||||
return Center(
|
||||
child: Text(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat/stream_chat.dart';
|
||||
|
||||
import '../stream_chat_flutter.dart';
|
||||
import 'stream_channel.dart';
|
||||
|
||||
/// It shows the current [Channel] name using a [Text] widget.
|
||||
@@ -22,15 +23,24 @@ class ChannelName extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final client = StreamChat.of(context);
|
||||
final channel = this.channel ?? StreamChannel.of(context).channel;
|
||||
return StreamBuilder<Map<String, dynamic>>(
|
||||
stream: channel.extraDataStream,
|
||||
initialData: channel.extraData,
|
||||
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(
|
||||
snapshot.data != null
|
||||
? (snapshot.data['name'] ?? channel.cid)
|
||||
: channel.cid,
|
||||
title,
|
||||
style: textStyle,
|
||||
);
|
||||
},
|
||||
|
||||
+14
-14
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
@@ -765,7 +766,7 @@ class _MessageInputState extends State<MessageInput> {
|
||||
});
|
||||
}
|
||||
|
||||
int _keyboardListener;
|
||||
StreamSubscription _keyboardListener;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -773,16 +774,8 @@ class _MessageInputState extends State<MessageInput> {
|
||||
|
||||
StreamChannel.of(context).queryMembersAndWatchers();
|
||||
|
||||
_keyboardListener = KeyboardVisibilityNotification().addNewListener(
|
||||
onHide: () {
|
||||
if (_commandsOverlay != null) {
|
||||
_commandsOverlay.remove();
|
||||
}
|
||||
if (_mentionsOverlay != null) {
|
||||
_mentionsOverlay.remove();
|
||||
}
|
||||
},
|
||||
onShow: () {
|
||||
_keyboardListener = KeyboardVisibility.onChange.listen((visible) {
|
||||
if (visible) {
|
||||
if (_commandsOverlay != null) {
|
||||
if (_textController.text.startsWith('/')) {
|
||||
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) {
|
||||
_textController = TextEditingController(text: widget.editMessage.text);
|
||||
@@ -842,7 +842,7 @@ class _MessageInputState extends State<MessageInput> {
|
||||
void dispose() {
|
||||
_commandsOverlay?.remove();
|
||||
_mentionsOverlay?.remove();
|
||||
KeyboardVisibilityNotification().removeListener(_keyboardListener);
|
||||
_keyboardListener.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,6 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
|
||||
createdAt: channel.createdAt,
|
||||
extraData: channel.extraData,
|
||||
type: channel.type,
|
||||
members: channel.state.members,
|
||||
memberCount: channel.memberCount,
|
||||
frozen: channel.frozen,
|
||||
cid: channel.cid,
|
||||
|
||||
@@ -8,11 +8,11 @@ class UserAvatar extends StatelessWidget {
|
||||
const UserAvatar({
|
||||
Key key,
|
||||
@required this.user,
|
||||
this.radius = 16,
|
||||
this.constraints,
|
||||
}) : super(key: key);
|
||||
|
||||
final User user;
|
||||
final double radius;
|
||||
final BoxConstraints constraints;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -20,7 +20,7 @@ class UserAvatar extends StatelessWidget {
|
||||
borderRadius:
|
||||
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.borderRadius,
|
||||
child: Container(
|
||||
constraints:
|
||||
constraints: constraints ??
|
||||
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints,
|
||||
decoration: BoxDecoration(
|
||||
color: StreamChatTheme.of(context).accentColor,
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
name: 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.
|
||||
version: 0.2.0-alpha+6
|
||||
version: 0.2.0-alpha+7
|
||||
|
||||
environment:
|
||||
sdk: ">=2.3.0 <3.0.0"
|
||||
@@ -10,17 +10,17 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
photo_view: ^0.9.2
|
||||
rxdart: ^0.24.0
|
||||
jiffy: ^3.0.1
|
||||
cached_network_image: ^2.1.0+1
|
||||
flutter_markdown: ^0.3.4
|
||||
flutter_markdown: ^0.3.5
|
||||
url_launcher: ^5.4.2
|
||||
video_player: ^0.10.8+1
|
||||
chewie: ^0.9.10
|
||||
rxdart: ^0.23.0
|
||||
file_picker: ^1.6.2
|
||||
file_picker: ^1.6.3+2
|
||||
image_picker: ^0.6.5
|
||||
flutter_keyboard_visibility: ^0.8.0
|
||||
stream_chat: ^0.2.0-alpha+4
|
||||
flutter_keyboard_visibility: ^2.0.0
|
||||
stream_chat: ^0.2.0-alpha+5
|
||||
mime: ^0.9.6+3
|
||||
visibility_detector: ^0.1.4
|
||||
http_parser: ^3.1.4
|
||||
|
||||
Reference in New Issue
Block a user