add stream chat theme draft

This commit is contained in:
Salvatore Giordano
2020-02-27 17:09:20 +01:00
parent a1308fb380
commit 541cafb49f
17 changed files with 647 additions and 128 deletions
+13 -10
View File
@@ -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,
);
},
);
}
}