Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class YourAdapter extends StatelessWidget {
  2.  
  3. final Function onItemTap;
  4.  
  5. YourAdapter(
  6. {
  7. this.onItemTap
  8. });
  9. //do something like this on the onPressed of your item
  10. IconButton(
  11. icon: Icon(icon),
  12. color: Colors.deepPurpleAccent,
  13. onPressed: () {
  14. //this is the method that you passed as the reference in the
  15. constructor. It will call the original function.
  16. onItemTap(x,y);
  17. },
  18. )
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement