Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class YourAdapter extends StatelessWidget {
- final Function onItemTap;
- YourAdapter(
- {
- this.onItemTap
- });
- //do something like this on the onPressed of your item
- IconButton(
- icon: Icon(icon),
- color: Colors.deepPurpleAccent,
- onPressed: () {
- //this is the method that you passed as the reference in the
- constructor. It will call the original function.
- onItemTap(x,y);
- },
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement