{"id":22007103,"url":"https://github.com/ricardodalarme/flutter_card_swiper","last_synced_at":"2026-01-11T04:06:32.266Z","repository":{"id":65217536,"uuid":"588359109","full_name":"ricardodalarme/flutter_card_swiper","owner":"ricardodalarme","description":"A Tinder-like card swiper package. It allows you to swipe left, right, up and down and define your own business logic for each direction.","archived":false,"fork":false,"pushed_at":"2024-10-09T00:11:14.000Z","size":12244,"stargazers_count":165,"open_issues_count":24,"forks_count":86,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T04:45:08.611Z","etag":null,"topics":["card-swiper","flutter","flutter-package","stacked-cards"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_card_swiper","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricardodalarme.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ricardodalarme"]}},"created_at":"2023-01-12T23:36:03.000Z","updated_at":"2025-03-30T16:01:17.000Z","dependencies_parsed_at":"2024-01-09T18:47:21.455Z","dependency_job_id":"5056628b-8dc8-4180-ba05-9ca1bedd940a","html_url":"https://github.com/ricardodalarme/flutter_card_swiper","commit_stats":{"total_commits":73,"total_committers":4,"mean_commits":18.25,"dds":0.06849315068493156,"last_synced_commit":"37fcbe4ebe307584f25eef733ca17fb5c1921f57"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardodalarme%2Fflutter_card_swiper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardodalarme%2Fflutter_card_swiper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardodalarme%2Fflutter_card_swiper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardodalarme%2Fflutter_card_swiper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardodalarme","download_url":"https://codeload.github.com/ricardodalarme/flutter_card_swiper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987184,"owners_count":21028891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["card-swiper","flutter","flutter-package","stacked-cards"],"created_at":"2024-11-30T01:17:17.309Z","updated_at":"2026-01-11T04:06:32.251Z","avatar_url":"https://github.com/ricardodalarme.png","language":"Dart","funding_links":["https://github.com/sponsors/ricardodalarme"],"categories":[],"sub_categories":[],"readme":"# flutter_card_swiper\n\n[![Pub Version](https://img.shields.io/pub/v/flutter_card_swiper?logo=dart\u0026logoColor=white)](https://pub.dev/packages/flutter_card_swiper)\n[![Pub Points](https://badgen.net/pub/points/flutter_card_swiper)](https://pub.dev/packages/flutter_card_swiper)\n[![Pub Likes](https://badgen.net/pub/likes/flutter_card_swiper)](https://pub.dev/packages/flutter_card_swiper)\n[![Pub popularity](https://badgen.net/pub/popularity/flutter_card_swiper)](https://pub.dev/packages/flutter_card_swiper)\n[![Tests](https://github.com/ricardodalarme/flutter_card_swiper/actions/workflows/code-check.yml/badge.svg)](https://github.com/ricardodalarme/flutter_card_swiper/actions/workflows/code-check.yml)\n[![codecov](https://codecov.io/gh/ricardodalarme/flutter_card_swiper/branch/main/graph/badge.svg?token=UW677LGCBF)](https://codecov.io/gh/ricardodalarme/flutter_card_swiper)\n\nThis is a Flutter package for a Tinder-like card swiper. ✨\n\nIt allows you to swipe left, right, up, and down and define your own business logic for each direction.\n\nVery smooth animations supporting Android, iOS, Web \u0026 Desktop.\n\n## Why?\n\nWe built this package because we wanted to:\n\n- Have a fully customizable slider\n- Swipe in any direction\n- Undo swipes as many times as you want\n- Choose your own settings such as duration, angle, padding and more\n- Trigger swipes in any direction with the controller\n- Add callbacks while swiping, on end, or when the swiper is disabled\n- Detect the direction (left, right, top, bottom) the card was swiped\n\n## Show Cases\n\n| Swipe in any direction | Trigger swipes | Unswipe the cards |\n| ---------------------- | :------------- | :---------------- |\n| \u003cimg src=\"https://github.com/ricardodalarme/flutter_card_swiper/blob/main/images/swiping.gif?raw=true\" height=\"275\" /\u003e | \u003cimg src=\"https://github.com/ricardodalarme/flutter_card_swiper/blob/main/images/swipe_left_right.gif?raw=true\" height=\"275\" /\u003e | \u003cimg src=\"https://github.com/ricardodalarme/flutter_card_swiper/blob/main/images/unswipe.gif?raw=true\" height=\"275\" /\u003e |\n\n| Fully customizable |\n| ------------------ | \n| \u003cimg src=\"https://github.com/ricardodalarme/flutter_card_swiper/blob/main/images/angle.gif?raw=true\" height=\"275\" /\u003e  \u003cimg src=\"https://github.com/ricardodalarme/flutter_card_swiper/blob/main/images/treshold.gif?raw=true\" height=\"275\" /\u003e  | \n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ncard_swiper: ...\n```\n\n**OR** run\n\n```yaml\nflutter pub add flutter_card_swiper\n```\n\nin your project's root directory.\n\n## Usage\n\nYou can place your `CardSwiper` inside of a `Scaffold` like we did here. Optional parameters can be defined to enable different features. See the following example:\n\n```dart\nimport 'package:flutter_card_swiper/flutter_card_swiper.dart';\nimport 'package:flutter/material.dart';\n\nclass Example extends StatelessWidget {\n  List\u003cContainer\u003e cards = [\n    Container(\n      alignment: Alignment.center,\n      child: const Text('1'),\n      color: Colors.blue,\n    ),\n    Container(\n      alignment: Alignment.center,\n      child: const Text('2'),\n      color: Colors.red,\n    ),\n    Container(\n      alignment: Alignment.center,\n      child: const Text('3'),\n      color: Colors.purple,\n    )\n  ];\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      body: Flexible(\n        child: CardSwiper(\n          cardsCount: cards.length,\n          cardBuilder: (context, index, percentThresholdX, percentThresholdY) =\u003e cards[index],\n        ),\n      ),\n    );\n  }\n}\n```\n\n## Constructor\n\n#### Basic\n\n| Parameter               | Default                                                             | Description                                                                                                                                                                                                                                                  | Required |\n|-------------------------|:--------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :------: |\n| cardBuilder             | -                                                                   | Widget builder for rendering cards                                                                                                                                                                                                                           |  true    |\n| cardsCount              | -                                                                   | Number of cards                                                                                                                                                                                                                                              |  true    |\n| controller              | -                                                                   | Controller to trigger swipe actions                                                                                                                                                                                                                          |  false   |\n| duration                | 200 milliseconds                                                    | The duration that every animation should last                                                                                                                                                                                                                |  false   |\n| initialIndex            | 0                                                                   | Index of the first card when the swiper is initialized                                                                                                                                                                                                       |  false   |\n| isDisabled              | false                                                               | Set to `true` if swiping should be disabled, has no impact when triggered from the outside                                                                                                                                                                   |  false   |\n| isLoop                  | true                                                                | Set to `true` if the stack should loop                                                                                                                                                                                                                       |  false   |\n| maxAngle                | 30                                                                  | Maximum angle that the card can reach during swiping                                                                                                                                                                                                         |  false   |\n| allowedSwipeDirection   | AllowedSwipeDirection.all                                           | Sets the direction in which the card can be swiped. It can be set to any combination of left, right up or down.                                                                                                                                              |  false   |\n| numberOfCardsDisplayed  | 2                                                                   | Number of cards displayed at the same time                                                                                                                                                                                                                   |  false   |\n| onEnd                   | -                                                                   | Callback when there are no more cards left to swipe                                                                                                                                                                                                          |  false   |\n| onSwipe                 | -                                                                   | Callback when the user swipes a card. If the function returns `false`, the swipe action is canceled. If it returns `true`, the swipe action is performed as expected                                                                                         |  false   |\n| onTapDisabled           | -                                                                   | Callback when a card is tapped and `isDisabled` is `true`                                                                                                                                                                                                    |  false   |\n| onUndo                  | -                                                                   | Callback when the controller calls undo. If the function returns `false`, the undo action is canceled. If it returns `true`, the undo action is performed as expected                                                                                        |  false   |\n| padding                 | EdgeInsets.symmetric(horizontal: 20, vertical: 25)                  | The padding around the swiper                                                                                                                                                                                                                                |  false   |\n| scale                   | 0.9                                                                 | Scale of the card that is behind the front card                                                                                                                                                                                                              |  false   |\n| threshold               | 50                                                                  | Threshold from which the card is swiped away                                                                                                                                                                                                                 |  false   |\n| onSwipeDirectionChange  | -                                                                   | A callback containing the horizontal and vertical swipe direction                                                                                                                                                                                            |  false   |\n| showBackCardOnUndo      | -                                                                   | If true, the previous card will be shown in the background when swiping, and the swipe action will trigger an undo                                                                                                                                           |  false   |\n| undoSwipeThreshold      | 50                                                                  | The horizontal swipe distance threshold, in pixels, after which the back card switches to the previous card. Only active when showBackCardOnUndo is true                                                                                                     |  false   |\n| undoDirection           | UndoDirection.left                                                  | The direction of the swipe to trigger an undo                                                                                                                                                                                                                |  false   |\n#### Controller\n\nThe `Controller` is used to swipe the card from outside of the widget. You can create a controller called `CardSwiperController` and save the instance for further usage. Please have a closer look at our [Example](https://github.com/ricardodalarme/flutter_card_swiper/tree/main/example) for the usage.\n\n| Method      | Description                                    |\n| ----------- | :--------------------------------------------- |\n| swipe       | Swipes the card to a specific direction.       |\n| undo        | Bring back the last card that was swiped away. |\n| moveTo      | Change the top card to a specific index.       |\n\n\u003chr/\u003e\n\n## Credits\n\n- **Ricardo Dalarme** (Package maintainer)\n- [**Appinio GmbH**](https://appinio.com) (Original project creator)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardodalarme%2Fflutter_card_swiper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardodalarme%2Fflutter_card_swiper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardodalarme%2Fflutter_card_swiper/lists"}