add image on tap

This commit is contained in:
Salvatore Giordano
2020-04-20 12:11:59 +02:00
parent b304979866
commit 9ad7d56217
2 changed files with 44 additions and 27 deletions
+10 -8
View File
@@ -57,15 +57,19 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
/// By default it calls [Navigator.pop]
final VoidCallback onBackPressed;
/// Callback to call when pressing the header is tapped.
/// Callback to call when the header is tapped.
final VoidCallback onTitleTap;
/// Callback to call when the image is tapped.
final VoidCallback onImageTap;
/// Creates a channel header
ChannelHeader({
Key key,
this.showBackButton = true,
this.onBackPressed,
this.onTitleTap,
this.onImageTap,
}) : preferredSize = Size.fromHeight(kToolbarHeight),
super(key: key);
@@ -80,18 +84,16 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
actions: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 10.0),
child: Stack(
children: <Widget>[
Center(
child: ChannelImage(),
),
],
child: Center(
child: ChannelImage(
onTap: onImageTap,
),
),
),
],
centerTitle: true,
title: InkWell(
onTap: () {},
onTap: onTitleTap,
child: Container(
height: preferredSize.height,
width: preferredSize.width,