flutter_swipe_button 1.1.0 icon indicating copy to clipboard operation
flutter_swipe_button: ^1.1.0 copied to clipboard

Avoid accidental clicks or dialogs to prevent them using SwipeButton.

flutter_swipe_button #

pub package License: MIT

Avoid accidental clicks or dialogs to prevent them using SwipeButton.

Screenshot #

Example 1Example 2Example 3

Getting Started #

Adding package #

flutter_swipe_button: ^1.1.0

Importing package #

import 'package:flutter_swipe_button/flutter_swipe_button.dart';

How to use #

SwipeButton.expand(
  thumb: Icon(
    Icons.double_arrow_rounded,
    color: Colors.white,
  ),
  child: Text(
    "Swipe to ...",
    style: TextStyle(
      color: Colors.red,
    ),
  ),
  activeThumbColor: Colors.red,
  activeTrackColor: Colors.grey.shade300,
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

SwipeButton(
  trackPadding: EdgeInsets.all(6),
  elevation: 2,
  child: Text(
    "Swipe to ...",
    style: TextStyle(
      color: Colors.white,
    ),
  ),
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

SwipeButton(
  thumbPadding: EdgeInsets.all(3),
  thumb: Icon(
    Icons.chevron_right,
    color: Colors.white,
  ),
  elevation: 2,
  child: Text(
    "Swipe to ...".toUpperCase(),
    style: TextStyle(
      color: Colors.white,
      fontSize: 18,
      fontWeight: FontWeight.bold,
    ),
  ),
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

SwipeButton(
  borderRadius: BorderRadius.circular(8),
  activeTrackColor: Colors.amber,
  height: 60,
  child: Text(
    "Swipe to ...",
    style: TextStyle(
      color: Colors.red,
    ),
  ),
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

SwipeButton(
  activeTrackColor: Colors.blue,
  activeThumbColor: Colors.yellow,
  borderRadius: BorderRadius.zero,
  height: 30,
  child: Text(
    "Swipe to ...",
    style: TextStyle(
      color: Colors.white,
    ),
  ),
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

SwipeButton(
  width: 200,
  child: Text(
    "Swipe to ...",
    style: TextStyle(
      color: Colors.white,
    ),
  ),
  onSwipe: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text("Swipped"),
        backgroundColor: Colors.green,
      ),
    );
  },
)

License #

MIT License
14
likes
100
pub points
88%
popularity

Publisher

unverified uploader

Avoid accidental clicks or dialogs to prevent them using SwipeButton.

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_swipe_button