refs #35: add title on tap
This commit is contained in:
+22
-10
@@ -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),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user