Open Hani961 opened 2 years ago
If you mean whether a swipe is like or not like, this is handled using the likeAction / nopeAction callback functions when you create the SwipeItems
Yeah just follow the example provided.
for (int i = 0; i < _names.length; i++) {
_swipeItems.add(SwipeItem(
content: Content(text: _names[i], color: _colors[i]),
likeAction: () {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text("Liked ${_names[i]}"),
duration: Duration(milliseconds: 500),
));
},
nopeAction: () {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text("Nope ${_names[i]}"),
duration: Duration(milliseconds: 500),
));
},
superlikeAction: () {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text("Superliked ${_names[i]}"),
duration: Duration(milliseconds: 500),
));
},
onSlideUpdate: (SlideRegion? region) async {
print("Region $region");
}));
}
_matchEngine = MatchEngine(swipeItems: _swipeItems);
super.initState();
}
please guide me through this I'm stuck with this