anupkumarpanwar / swipe_cards Goto Github PK
View Code? Open in Web Editor NEWTinder like swipe cards for flutter.
Home Page: https://pub.dev/packages/swipe_cards
License: BSD 3-Clause "New" or "Revised" License
Tinder like swipe cards for flutter.
Home Page: https://pub.dev/packages/swipe_cards
License: BSD 3-Clause "New" or "Revised" License
please guide me through this I'm stuck with this
whatever touched top or bottom , always rotate top to left when swipe to left and rotate to right when swipe to right ?
This L287 throwing an error of The getter 'width' was called on null.
Is there a way to fix this?
List<SwipeItem> _swipeItems = [];
final MatchEngine matchEngine = new MatchEngine(
swipeItems: edges.map((edge) {
final post = Post.fromJson(edge);
final swipeItem = SwipeItem(
content: post,
likeAction: () {
launchURL(post.node.slug);
},
);
_swipeItems.add(swipeItem);
return swipeItem;
}).toList());
return MyHomePage(
matchEngine: matchEngine,
swipeItems: _swipeItems,
);
Using it as follows.
Then in MyHomePage
Scaffold(
appBar: _buildAppBar(),
body: Center(
child: Container(
constraints: BoxConstraints(
minWidth: 300,
maxWidth: 500,
maxHeight: 730,
),
padding: EdgeInsets.all(10),
child: SwipeCards(
matchEngine: matchEngine,
itemBuilder: (BuildContext context, int index) {
return ProfileCard(
post: swipeItems[index].content,
);
},
onStackFinished: () {
print('finished');
},
),
),
),
bottomNavigationBar: _buildBottomBar(),
);
I want to say a big thank you for creating this package. I love your package and it is helpful
I wanted to make sure that cards on the stack did not finish from the stack, so I re-initialized like below:
void initState() {
super.initState();
_init();
}
void _init() {
for (int i = 0; i < matches.length; i++) {
_swipeItems.add(
SwipeItem(
content: MatchData(
image: matches[i].image,
userName: matches[i].userName,
age: matches[i].age,
gender: matches[i].gender,
role: matches[i].role,
travelingTo: matches[i].travelingTo,
opt1: matches[i].opt1,
opt2: matches[i].opt2,
isVerified: matches[i].isVerified,
numberOfTipsGiven: matches[i].numberOfTipsGiven,
startMonth: matches[i].startMonth,
endMonth: matches[i].endMonth,
travelYear: matches[i].travelYear,
travelAideRating: matches[i].travelAideRating,
selectedOpt: matches[i].selectedOpt),
),
);
}
_matchEngine = MatchEngine(swipeItems: _swipeItems);
Provider.of<RequestProvider>(context, listen: false).matchEngine =
_matchEngine!;
}```
but methods from the matchmachine which I believe is the Controller, stops working unexpectedly
``` widget.matchEngine.currentItem?.nope();
How do I resolve this?
Sometimes back card swiped. Please do the needful. I am attached the video, Please go through it.
Uploading 2021_08_18_17_10_45_trim.mp4…
Quite minor issue.
When card has a shadow, the initial shadow is darker than it should. It's visible in the video from the other issue:
#13
Notice how the shadow gets darker when the card loads.
I guess it could be caused by the bottom card not being applied the 0.9 transformation on initial render, but seemed good in the code, so not sure.
Hello,
It seems that in "draggable_card.dart" the AnimationController slideOutAnimation should be disposed in dispose method like the slideBackAnimation is ?
when we swipe 50% of a user profile or example, it does not show next user image as pre loaded, if i swipe user for 50% or more, then next user profile should be visible lke swipe funcction of other dating apps like tinder etc
This is my need:
After swiping, when there are only 5 cards left, I need to insert/append more cards
How to achieve this?
Please provide loop functionality. If the images are completed then the black page is showing.
If you swipe through all of the cards, and then undo the last one using matchEngine.rewindMatch()
, you get a Null error.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
Hi there, I'm using this plugin and I would like to know if is possible to show the complete stack each card with a different top position relative between each other, that way the user can see the full stack of cards, this is to create a deck effect and give more visibility to the user.
thanks
In my app I use a textField inside of a SwipeItem sometimes.
When autofocus: true
is set, the keyboard opens automatically causing the cards to re-size. This is the expected behaviour, but if the card behind has a textField and the card infront does not, the keyboard is opened also.
Is there anyway from inside the SwipeItem to tell if it's the current item? or a callback that fires when it becomes the current item?
thanks,
Jesse,
When you swipe really fast the card behind can sometimes get picked up and swiped.
can u help with seperate repo for this or add option to the plugins
I've found a bug that occurs when you change cards in the match engine, sometime the front card would not render.
The fix:
in swipe_cards
build method:
DraggableCard(
key: ValueKey(widget.matchEngine.currentItem!.content), // Add a key --> you'll also need to add the key param to the draggable card widget
I won't do a PR because I have a lot of custom changes in my fork, but this could save someone a few hours of debugging.
Whenever a card is being dragged, the back card will still show the same content of the front card.
The content of the back card is only loaded when the front card is completely swiped; in the meantime it will still show the swiped card content.
Attached you can find evidence of this behavior. I followed the example from pub.dev to create the stack as well.
add image list example readme file.. good work.
An ability to configure swipes directions would be really great.
final allowedActions = [
SwipeDirection.right,
SwipeDirection.left,
];
Something like this or
final notAllowedActions = [
SwipeDirection.up,
SwipeDirection.down,
];
左右滑动后发送请求,请求失败的情况下,怎么让卡片返回来
Hey I think there is need of onSwipeUpdateCallback just like
onSwipeUpdateCallback(DragUpdateDetails details, Alignment align) { }
I need drapupdatedetails and Alignment or offset while swiping a card.
Thanks
Hello, I have added an admob banner on the swipe card, and when I try to swipe, it is not working correctly.
When I swipe the card, it getting returning back and stuck the swipe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.