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
+22 -10
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,17 +90,25 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
), ),
], ],
centerTitle: true, centerTitle: true,
title: Column( title: InkWell(
crossAxisAlignment: CrossAxisAlignment.center, onTap: () {},
children: <Widget>[ child: Container(
ChannelName( height: preferredSize.height,
textStyle: StreamChatTheme.of(context) width: preferredSize.width,
.channelTheme child: Column(
.channelHeaderTheme crossAxisAlignment: CrossAxisAlignment.center,
.title, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ChannelName(
textStyle: StreamChatTheme.of(context)
.channelTheme
.channelHeaderTheme
.title,
),
_buildLastActive(context, channel),
],
), ),
_buildLastActive(context, channel), ),
],
), ),
); );
} }