feat: Added a way to disable info tiles and added info tile to message list view

This commit is contained in:
Deven Joshi
2021-01-12 21:13:38 +05:30
parent 0bb76bab39
commit fad38a513a
3 changed files with 201 additions and 158 deletions
+5 -2
View File
@@ -69,6 +69,8 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
/// If true the typing indicator will be rendered if a user is typing
final bool showTypingIndicator;
final bool showConnectionStateTile;
/// Creates a channel header
ChannelHeader({
Key key,
@@ -77,6 +79,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
this.onTitleTap,
this.showTypingIndicator = true,
this.onImageTap,
this.showConnectionStateTile = false,
}) : preferredSize = Size.fromHeight(kToolbarHeight),
super(key: key);
@@ -97,7 +100,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
showStatus = false;
break;
case ConnectionStatus.connecting:
statusString = 'Connecting';
statusString = 'Reconnecting...';
break;
case ConnectionStatus.disconnected:
statusString = 'Disconnected';
@@ -105,7 +108,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
}
return InfoTile(
showMessage: showStatus,
showMessage: showConnectionStateTile ? showStatus : false,
message: statusString,
child: AppBar(
brightness: Theme.of(context).brightness,