Skip to content

Custom callbacks

Michał Kawałko edited this page Apr 10, 2020 · 1 revision

onTapImage

function called when user clicks on a image in a TweetView, CompactTweetView or QuoteTweetView. typedef OnTapImage = void Function(List<String> allPhotos, int photoIndex, String hashcode);

TweetView.fromTweet(
  Tweet.fromRawJson(
    snapshot.data,
  ),
  onTapImage: openImage,
);

void openImage(List<String> allPhotos, int photoIndex, String hashcode) {
  print("Opened ${allPhotos[photoIndex]}");
}
Clone this wiki locally