Member-only story

Tinder Swipe Animation in Flutter

Huma Farheen
11 min readSep 29, 2020

--

So, Stumbling upon animation in flutter, i wanted to get a hold on the working of it.

I implemented and learnt swipe feature which includes -

  • Swipe by button press
  • Swipe by gesture detection

Lets get started, for the first part, swipe by gesture detection

Steps -

  1. Add a container or a card. Basically the widget u want to swipe
  2. Wrap with gesture detector
  3. Set alignment of widget according to onDragUpdate details
  4. When drag is finished , start animation

Lets begin with the first step

Step 1. Create your swipe widget

I have made a simple widget with a container wrapping my image widget

class MyCard extends StatelessWidget {
const MyCard({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: new Border.all(
width: 5.0,
color: Colors.grey.withOpacity(0.2),
),
borderRadius: BorderRadius.circular(20)),
height: MediaQuery.of(context).size.width * 0.9,
width: MediaQuery.of(context).size.width * 0.9,
child…

--

--

Huma Farheen
Huma Farheen

Written by Huma Farheen

Flutter developer, AI enthusiast

Responses (2)