refs #35: add title on tap

This commit is contained in:
Salvatore Giordano
2020-04-20 11:49:42 +02:00
parent a21319d88e
commit b304979866
+13 -1
View File
@@ -57,11 +57,15 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
/// By default it calls [Navigator.pop] /// By default it calls [Navigator.pop]
final VoidCallback onBackPressed; final VoidCallback onBackPressed;
/// Callback to call when pressing the header is tapped.
final VoidCallback onTitleTap;
/// Creates a channel header /// Creates a channel header
ChannelHeader({ ChannelHeader({
Key key, Key key,
this.showBackButton = true, this.showBackButton = true,
this.onBackPressed, this.onBackPressed,
this.onTitleTap,
}) : preferredSize = Size.fromHeight(kToolbarHeight), }) : preferredSize = Size.fromHeight(kToolbarHeight),
super(key: key); super(key: key);
@@ -86,8 +90,14 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
), ),
], ],
centerTitle: true, centerTitle: true,
title: Column( title: InkWell(
onTap: () {},
child: Container(
height: preferredSize.height,
width: preferredSize.width,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
ChannelName( ChannelName(
textStyle: StreamChatTheme.of(context) textStyle: StreamChatTheme.of(context)
@@ -98,6 +108,8 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
_buildLastActive(context, channel), _buildLastActive(context, channel),
], ],
), ),
),
),
); );
} }