-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swiping like an arc with controller #47
Comments
By the way, just taking a moment to thank you for this library! Truly makes lives easy - I should say best pick for card swiping packages out there in pub.dev. Also, just want to let you know that, if this sounds good, I'll be happy to raise another PR for this. :) In fact, I've tried implementing this in my fork here: HeySreelal/flutter_card_swiper/feat-arc-swipe. Let me add couple of screen recording to illustrate this. Screen Recordings1. Normal BehaviorCode: FloatingActionButton(
onPressed: () {
const dir = CardSwiperDirection.left;
controller.swipe(dir);
},
child: const Icon(Icons.keyboard_arrow_left),
),
FloatingActionButton(
onPressed: () {
const dir = CardSwiperDirection.right;
controller.swipe(dir);
},
child: const Icon(Icons.keyboard_arrow_right),
), Screen.Recording.2024-10-06.at.1.20.52.PM.mov2. Swiping to custom angleCode: FloatingActionButton(
onPressed: () {
final dir = CardSwiperDirection.custom(290);
controller.swipe(dir);
},
child: const Icon(Icons.keyboard_arrow_left),
),
FloatingActionButton(
onPressed: () {
final dir = CardSwiperDirection.custom(60);
controller.swipe(dir);
},
child: const Icon(Icons.keyboard_arrow_right),
), Screen.Recording.2024-10-06.at.1.21.26.PM.mov3. Swiping to custom angle as arcCode: FloatingActionButton(
onPressed: () {
final dir = CardSwiperDirection.custom(290);
controller.swipeArc(
dir,
curve: Curves.easeInOut,
);
},
child: const Icon(Icons.undo),
),
FloatingActionButton(
onPressed: () {
final dir = CardSwiperDirection.custom(60);
controller.swipeArc(
dir,
curve: Curves.easeInOut,
);
},
child: const Icon(Icons.redo),
), Screen.Recording.2024-10-06.at.1.21.03.PM.movThat's it, hoping this would be a cool addition :) Looking forward to hearing from you, thanks :) |
guys is this implemented ? i cannot find custom in the enums im at 7.0.2 |
Hi @ricardodalarme, I've recently added a PR #46 which contains the implementation for swiping to any given angle with the controller where as of now controller can only swipe the card to the predefined
left
,right
,top
,bottom
directions.#46 brings the ability to swipe to any given angle with the
CardSwiperDirection.custom
constructor to specify angle at which the card should be swiped.But, along the way while I was implementing it, I had this idea in mind - generally humans swipe items on the screen like an arc or something - why can't we have that? Right now, even the swiping to custom angle basically moves the container in a linear path.
Can we add the
CardSwiperController.swipeArc
for this? Or do I sound way too stupid? :)The text was updated successfully, but these errors were encountered: