add stream chat theme draft
This commit is contained in:
+13
-10
@@ -5,22 +5,25 @@ class ChannelName extends StatelessWidget {
|
||||
const ChannelName({
|
||||
Key key,
|
||||
@required this.channel,
|
||||
this.textStyle,
|
||||
}) : super(key: key);
|
||||
|
||||
final Channel channel;
|
||||
final TextStyle textStyle;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return StreamBuilder<Map<String, dynamic>>(
|
||||
stream: channel.extraDataStream,
|
||||
initialData: channel.extraData,
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
snapshot.data != null
|
||||
? (snapshot.data['name'] ?? channel.cid)
|
||||
: channel.cid,
|
||||
style: Theme.of(context).textTheme.body2,
|
||||
);
|
||||
});
|
||||
stream: channel.extraDataStream,
|
||||
initialData: channel.extraData,
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
snapshot.data != null
|
||||
? (snapshot.data['name'] ?? channel.cid)
|
||||
: channel.cid,
|
||||
style: textStyle,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user