Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/tile.dart Secret
Created Jan 13, 2019

What would you like to do?
class Tile extends StatelessWidget {
final VoidCallback onTap; //<--new parameter
const Tile({Key key, this.height, this.state, this.onTap}) : super(key: key);
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
You can’t perform that action at this time.