update pubspec
This commit is contained in:
@@ -1,29 +0,0 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:stream_chat/stream_chat.dart';
|
|
||||||
|
|
||||||
class ChannelAvatar extends StatelessWidget {
|
|
||||||
const ChannelAvatar({
|
|
||||||
Key key,
|
|
||||||
@required this.channel,
|
|
||||||
this.radius = 20,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final Channel channel;
|
|
||||||
final double radius;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return CircleAvatar(
|
|
||||||
radius: radius,
|
|
||||||
backgroundImage: channel.extraData.containsKey('image')
|
|
||||||
? CachedNetworkImageProvider(channel.extraData['image'])
|
|
||||||
: null,
|
|
||||||
child: channel.extraData.containsKey('image')
|
|
||||||
? null
|
|
||||||
: Text(channel.extraData.containsKey('name')
|
|
||||||
? channel.extraData['name'][0]
|
|
||||||
: ''),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,20 +6,24 @@ class ChannelImage extends StatelessWidget {
|
|||||||
const ChannelImage({
|
const ChannelImage({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.channel,
|
@required this.channel,
|
||||||
|
this.radius = 20,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final Channel channel;
|
final Channel channel;
|
||||||
|
final double radius;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CircleAvatar(
|
return CircleAvatar(
|
||||||
radius: 20,
|
radius: radius,
|
||||||
backgroundImage: channel.extraData.containsKey('image')
|
backgroundImage: channel.extraData.containsKey('image')
|
||||||
? CachedNetworkImageProvider(channel.extraData['image'] as String)
|
? CachedNetworkImageProvider(channel.extraData['image'])
|
||||||
: null,
|
: null,
|
||||||
child: channel.extraData.containsKey('image')
|
child: channel.extraData.containsKey('image')
|
||||||
? null
|
? null
|
||||||
: Text(channel.config.name[0]),
|
: Text(channel.extraData.containsKey('name')
|
||||||
|
? channel.extraData['name'][0]
|
||||||
|
: ''),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -19,8 +19,7 @@ dependencies:
|
|||||||
video_player: ^0.10.7
|
video_player: ^0.10.7
|
||||||
chewie: ^0.9.8+1
|
chewie: ^0.9.8+1
|
||||||
animations: ^1.0.0+3
|
animations: ^1.0.0+3
|
||||||
stream_chat:
|
stream_chat: ^0.1.6
|
||||||
path: ../stream_chat_dart
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
pedantic: ^1.8.0+1
|
pedantic: ^1.8.0+1
|
||||||
|
|||||||
Reference in New Issue
Block a user