[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9504":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},9504,"tinder_cards","Ivaskuu\u002Ftinder_cards","Ivaskuu","Tinder like cards swipe effect with Flutter.","",null,"Dart",968,120,22,8,0,4,47.65,false,"master",true,[],"2026-06-12 04:00:45","# Tinder cards\n\nHi! After showcasing [Focus for Reddit](https:\u002F\u002Fplay.google.com\u002Fstore\u002Fapps\u002Fdetails?id=com.skuu.focusreddit), the app I am working on, people asked me how did I do the tinder like cards swipe (posts media are shown as a stack of 3 swipable cards) and if I could make tutorial or open-source it:\n\n![Focus for Reddit preview](https:\u002F\u002Fi.imgur.com\u002FvVyY7O5.gif)\n\nAnd I did it! Here it is. I've created a Tinder like user interface (not working, that's not the point).\n\n![Focus for Reddit preview](https:\u002F\u002Fi.imgur.com\u002FPM9AhLX.gif)\n\nI've found 2 ways of doing this (there may be way more ways)\n - Using Draggable\n - Using GestureDetector and Alignment (what I use for my app)\n\nP.S: Use the appBar switch to go from Draggable cards section to GestureDetector and Alignment cards section.\n\n# Draggable\nThis technique uses the already implemented drag system in Flutter. It's also pretty easy to set up:\n - Stack\n   - Row with DragTargets\n   - IgnorePointer with ProfileCard (IgnorePointer so the top card Draggable touches the DragTarget)\n   - IgnorePointer with ProfileCard\n   - Draggable with ProfileCard\n\nHow does this work? Well, when the Draggable is dragged by the user, if there's a DragTest widget under the finger, it will execute the DragTest onWillAccept function, or onAccept if the card is released over. Also, when released, it will return to the default position, then call changeCardsOrder() which moves the cards by 1 and creates a new ProfileCard for the last card.\n\nThe problem with this technique is that you can't get the Draggable position while it is being swiped. So when released it will pop to the default position, and the return movement can't be animated (or going off the screen like in my app). Another problem (for me) is that you can't update the Draggable while it is swiped. It stays the same as when the user started dragging, and setState() takes effect only after being released. So, no way to slightly rotate the card while it is moving (which was very important for me).\n\n# Gesture detector and Alignment\nAs cards are placed in a Stack, each of them needs an Align widget to specify it's position in the stack. In this technique, a DragTarget is placed over the Stack.\nThe user thinks he is swiping the front card but in reality he is just triggering the onPanUpdate() function of the GestureDetector. The amount the finger moves each frame is added to the Alignment of the front card, modified by a speed constant (otherwise the card would go too fast or too slow).\nThe card rotation is then calculated based on the front card x alignment. On finger release, if the card alignment.x is bigger than a certain value, the swipe is considered valid and changeCardsOrder() is called.\n - Stack\n   - ProfileCard\n   - ProfileCard\n   - ProfileCard\n   - GestureDetector\n  \n## How animation works\n\u002F\u002F TODO\n\n\u003Chr>\n\nFor help getting started with Flutter, view our online\n[documentation](https:\u002F\u002Fflutter.io\u002F).","该项目实现了一个类似Tinder卡片滑动效果的Flutter组件。其核心功能是通过两种方法（使用Draggable和GestureDetector与Alignment结合）来模拟卡片堆叠并可左右滑动的效果，用户可以根据需要选择合适的方法。技术上，项目利用了Flutter的Stack、Row、Draggable、GestureDetector等组件，支持自定义卡片布局和动画效果。此项目非常适合需要在移动应用中实现类似Tinder卡片交互体验的开发者使用，无论是社交应用还是其他类型的应用都能从中受益。",2,"2026-06-11 03:23:08","top_language"]