Skip to content

kyleb-app/swipe_left

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swipe Left

A Flutter package that adds swipe-to-reveal-action buttons to any widget. Supports revealing one or two action buttons with fully customizable colors, sizes, and callbacks.

Features

  • Swipe left on any widget to reveal action buttons
  • Choose between one button (SwipeLeft) or two buttons (SwipeLeft2Buttons)
  • Customizable button titles, colors, sizes, and actions
  • Smooth slide animation

Installation

Add swipe_left to your pubspec.yaml:

dependencies:
  swipe_left:
    git:
      url: https://github.com/kylebessemer/swipe_left

Usage

Single Button

SwipeLeft(
  height: 75,
  backgroundColor: Colors.white,
  buttonFontSize: 12.0,
  buttonWidth: 75.0,
  buttonTitle: 'Delete',
  buttonBackgroundColor: Colors.red,
  buttonFontColor: Colors.white,
  buttonAction: () {
    // your action code here
  },
  child: Container(
    height: 75,
    width: MediaQuery.of(context).size.width,
    color: Colors.white,
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Icon(Icons.account_balance),
        Text("My Swipe Left Button"),
      ],
    ),
  ),
)

Two Buttons

SwipeLeft2Buttons(
  height: 75,
  backgroundColor: Colors.white,
  buttonFontSize: 12.0,
  buttonWidth: 75.0,
  button1Title: 'Info',
  button1BackgroundColor: Colors.blue,
  button1FontColor: Colors.white,
  button2Title: 'Delete',
  button2BackgroundColor: Colors.red,
  button2FontColor: Colors.white,
  button1Action: () {
    // your action code here
  },
  button2Action: () {
    // your action code here
  },
  child: Container(
    height: 75,
    width: MediaQuery.of(context).size.width,
    color: Colors.white,
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Icon(Icons.account_balance),
        Text("My Swipe Left Button"),
      ],
    ),
  ),
)

Parameters

SwipeLeft

Parameter Type Description
height double Height of the widget
backgroundColor Color Background color behind the button
buttonTitle String Button label text
buttonBackgroundColor Color Button background color
buttonFontColor Color Button text color
buttonFontSize double Button text size
buttonWidth double Button width
buttonAction VoidCallback Callback when the button is tapped
child Widget The widget displayed on top

SwipeLeft2Buttons

Same as SwipeLeft, but with button1* and button2* prefixed parameters for each button.

License

MIT License. See LICENSE for details.

About

A Swipe Left button plugin for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors