diff --git a/CHANGELOG.md b/CHANGELOG.md index ef2bb9d0..b8e8ea69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2 + +- Fix avatar shape + ## 0.1.1 - Add ThreadHeader diff --git a/README.md b/README.md index 723342a7..b40b8a6f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ TODO ```yaml dependencies: - stream_chat_flutter: ^0.1.1 + stream_chat_flutter: ^0.1.2 ``` You should then run `flutter packages get` diff --git a/example/lib/multiple_conversation.dart b/example/lib/multiple_conversation.dart index 054a9379..bbf20812 100644 --- a/example/lib/multiple_conversation.dart +++ b/example/lib/multiple_conversation.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart'; void main() async { - final client = Client('qk4nn7rpcn75', logLevel: Level.INFO); + final client = Client('s2dxdhpxd94g', logLevel: Level.INFO); await client.setUser( - User(id: 'wild-breeze-7'), - 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoid2lsZC1icmVlemUtNyJ9.VM2EX1EXOfgqa-bTH_3JzeY0T99ngWzWahSauP3dBMo', + User(id: 'still-resonance-3'), + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3RpbGwtcmVzb25hbmNlLTMifQ.e6BGSX21gLZYpls_rFX8PB2SfGlfdpvv00pQiVW70VQ', ); runApp(MyApp(client)); diff --git a/lib/src/channel_image.dart b/lib/src/channel_image.dart index 3f0dc0dd..03b18a92 100644 --- a/lib/src/channel_image.dart +++ b/lib/src/channel_image.dart @@ -19,32 +19,34 @@ class ChannelImage extends StatelessWidget { stream: channel.extraDataStream, initialData: channel.extraData, builder: (context, snapshot) { - return Container( - padding: const EdgeInsets.all(4), - constraints: StreamChatTheme.of(context) + return ClipRRect( + borderRadius: StreamChatTheme.of(context) .channelPreviewTheme .avatarTheme - .constraints, - decoration: BoxDecoration( - borderRadius: StreamChatTheme.of(context) + .borderRadius, + child: Container( + constraints: StreamChatTheme.of(context) .channelPreviewTheme .avatarTheme - .borderRadius, - color: StreamChatTheme.of(context).accentColor, + .constraints, + decoration: BoxDecoration( + color: StreamChatTheme.of(context).accentColor, + ), + child: snapshot.data?.containsKey('image') ?? false + ? CachedNetworkImage( + imageUrl: snapshot.data['image'], + errorWidget: (_, __, ___) { + return Center( + child: Text( + snapshot.data?.containsKey('name') ?? false + ? snapshot.data['name'][0] + : ''), + ); + }, + fit: BoxFit.cover, + ) + : SizedBox(), ), - child: snapshot.data?.containsKey('image') ?? false - ? CachedNetworkImage( - imageUrl: snapshot.data['image'], - errorWidget: (_, __, ___) { - return Center( - child: Text(snapshot.data?.containsKey('name') ?? false - ? snapshot.data['name'][0] - : ''), - ); - }, - fit: BoxFit.cover, - ) - : SizedBox(), ); }); } diff --git a/lib/src/user_avatar.dart b/lib/src/user_avatar.dart index 4c78b254..344fdaa8 100644 --- a/lib/src/user_avatar.dart +++ b/lib/src/user_avatar.dart @@ -16,30 +16,29 @@ class UserAvatar extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.all(4), - constraints: - StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints, - decoration: BoxDecoration( - borderRadius: StreamChatTheme.of(context) - .ownMessageTheme - .avatarTheme - .borderRadius, - color: StreamChatTheme.of(context).accentColor, + return ClipRRect( + borderRadius: + StreamChatTheme.of(context).ownMessageTheme.avatarTheme.borderRadius, + child: Container( + constraints: + StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints, + decoration: BoxDecoration( + color: StreamChatTheme.of(context).accentColor, + ), + child: user.extraData?.containsKey('image') ?? false + ? CachedNetworkImage( + imageUrl: user.extraData['image'], + errorWidget: (_, __, ___) { + return Center( + child: Text(user.extraData?.containsKey('name') ?? false + ? user.extraData['name'][0] + : ''), + ); + }, + fit: BoxFit.cover, + ) + : SizedBox(), ), - child: user.extraData?.containsKey('image') ?? false - ? CachedNetworkImage( - imageUrl: user.extraData['image'], - errorWidget: (_, __, ___) { - return Center( - child: Text(user.extraData?.containsKey('name') ?? false - ? user.extraData['name'][0] - : ''), - ); - }, - fit: BoxFit.cover, - ) - : SizedBox(), ); } } diff --git a/pubspec.yaml b/pubspec.yaml index ad2f7788..f64c5150 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.1.1 +version: 0.1.2 environment: sdk: ">=2.1.0 <3.0.0"