add header

This commit is contained in:
Salvatore Giordano
2020-02-27 10:37:44 +01:00
parent 31357c56b9
commit f93430b11d
9 changed files with 127 additions and 17 deletions
+11 -6
View File
@@ -11,11 +11,16 @@ class ChannelName extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Text(
channel?.extraData != null
? (channel?.extraData['name'] ?? channel.cid)
: channel.cid,
style: Theme.of(context).textTheme.body2,
);
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,
);
});
}
}