fix avatar shape
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 0.1.2
|
||||||
|
|
||||||
|
- Fix avatar shape
|
||||||
|
|
||||||
## 0.1.1
|
## 0.1.1
|
||||||
|
|
||||||
- Add ThreadHeader
|
- Add ThreadHeader
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ TODO
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
dependencies:
|
dependencies:
|
||||||
stream_chat_flutter: ^0.1.1
|
stream_chat_flutter: ^0.1.2
|
||||||
```
|
```
|
||||||
|
|
||||||
You should then run `flutter packages get`
|
You should then run `flutter packages get`
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
final client = Client('qk4nn7rpcn75', logLevel: Level.INFO);
|
final client = Client('s2dxdhpxd94g', logLevel: Level.INFO);
|
||||||
|
|
||||||
await client.setUser(
|
await client.setUser(
|
||||||
User(id: 'wild-breeze-7'),
|
User(id: 'still-resonance-3'),
|
||||||
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoid2lsZC1icmVlemUtNyJ9.VM2EX1EXOfgqa-bTH_3JzeY0T99ngWzWahSauP3dBMo',
|
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3RpbGwtcmVzb25hbmNlLTMifQ.e6BGSX21gLZYpls_rFX8PB2SfGlfdpvv00pQiVW70VQ',
|
||||||
);
|
);
|
||||||
|
|
||||||
runApp(MyApp(client));
|
runApp(MyApp(client));
|
||||||
|
|||||||
+23
-21
@@ -19,32 +19,34 @@ class ChannelImage extends StatelessWidget {
|
|||||||
stream: channel.extraDataStream,
|
stream: channel.extraDataStream,
|
||||||
initialData: channel.extraData,
|
initialData: channel.extraData,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return Container(
|
return ClipRRect(
|
||||||
padding: const EdgeInsets.all(4),
|
borderRadius: StreamChatTheme.of(context)
|
||||||
constraints: StreamChatTheme.of(context)
|
|
||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
.avatarTheme
|
.avatarTheme
|
||||||
.constraints,
|
.borderRadius,
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
borderRadius: StreamChatTheme.of(context)
|
constraints: StreamChatTheme.of(context)
|
||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
.avatarTheme
|
.avatarTheme
|
||||||
.borderRadius,
|
.constraints,
|
||||||
color: StreamChatTheme.of(context).accentColor,
|
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(),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-23
@@ -16,30 +16,29 @@ class UserAvatar extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ClipRRect(
|
||||||
padding: const EdgeInsets.all(4),
|
borderRadius:
|
||||||
constraints:
|
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.borderRadius,
|
||||||
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints,
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
constraints:
|
||||||
borderRadius: StreamChatTheme.of(context)
|
StreamChatTheme.of(context).ownMessageTheme.avatarTheme.constraints,
|
||||||
.ownMessageTheme
|
decoration: BoxDecoration(
|
||||||
.avatarTheme
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
.borderRadius,
|
),
|
||||||
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(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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.1.1
|
version: 0.1.2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.1.0 <3.0.0"
|
sdk: ">=2.1.0 <3.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user