yagnikbarasiya2306@gmail.com

Flutter · Swipe to confirm

Latch

Confirm with intent, not a tap.

A swipe-to-confirm button for Flutter. The thumb resists at first, clicks at the latch point, then runs your action with loading, success and failure states.

Platform
Flutter 3.47+ · Android, iOS, web
Size
Single Dart file
Dependencies
None
Licence
MIT · free for client work

Demo

A recording of the demo. Open it in a new tab

What it does

  1. 01

    Resistance at the start so a stray touch never confirms

  2. 02

    Spring release that keeps the speed you let go at

  3. 03

    Async confirm with a spinner, success morph or a shake on failure

  4. 04

    Enter, Space and screen reader activation without swiping

Use it

Add to pubspec.yamlyaml
dependencies:
  latch_swipe_confirm:
    git:
      url: https://github.com/YagnikBarasiya23/latch_swipe_confirm.git
Exampledart
import 'package:latch_swipe_confirm/latch_swipe_confirm.dart';

LatchSwipeConfirm(
  label: 'Swipe to pay ₹1,499',
  doneLabel: 'Paid',
  failedLabel: 'Card declined',
  onConfirm: () async {
    await payments.charge(order); // throw, or return false, to fail
    return true;
  },
)

Every option, the technique behind the motion and the accessibility notes are in the README on GitHub

More components

All 10
  • Flutter

    10 · Streak counter

    Ember

    A streak you can feel burning.

    • Single Dart file
    • No dependencies
    • Free · MIT
  • Web

    01 · Rolling number counter

    Tally

    Digits turn over like an odometer.

    • 3.6 KB gzip
    • No dependencies
    • Free · MIT

Get in touch

Open for freelance projects, contract roles and collaborations — mobile apps and full-stack products in particular. WhatsApp gets the fastest reply.

Based in
Rajkot, Gujarat, India
Elsewhere