How do I make the entire row clickable in flutter?. I have the following code wrap in a "GestureDetector". The individual items in the row are clickable but white space around the widget are not.
if ((auth.isLoggedIn)) ...[
GestureDetector(
onTap: () {
auth.signOut();
},
child: buildItem(
Image.asset("assets/images/logoff.png",),
"logout"
),
),
],
This is the "buildItem" method
Widget buildItem(Widget icon, String title) {
return Padding(
padding: const EdgeInsets.only(left: 20, right: 15),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: Row(
children: <Widget>[
icon,
SizedBox(width: 20.0),
Text(
title,
style: TextStyle(
fontSize: 16.0,
),
),
],
)),
Icon(
Icons.arrow_forward_ios,
size: 20.0,
),
],
),
);
}
This is the output. Each item in the row (icon, text and the >) respond to the tap gesture. However, the white space(e.g between the text and the ">") does not respond to tap
How can I make entire row respond to the tap.


