-
-
Save MarcinusX/9f9828cadb24a7dc1fd77641ee2b6d6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tile extends StatelessWidget { | |
final VoidCallback onTap; //<--new parameter | |
const Tile({Key key, this.height, this.state, this.onTap}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return SizedBox( | |
width: double.infinity, | |
height: height, | |
child: GestureDetector( | |
onTapDown: (_) => onTap(), //<-- call onTap | |
child: Container(color: color), | |
), | |
); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment