Flutter slidable custom - A Flutter implementation of slidable list item with directional slide actions that can be dismissed

Overview

Pub BuyMeACoffee

Slidable is a Flutter Favorite package!

flutter_slidable

A Flutter implementation of slidable list item with directional slide actions that can be dismissed.

Sponsors

Our top sponsors are shown below! [Become a Sponsor]


Try the Flutter Chat Tutorial   πŸ’¬

Migration from 0.6.0

You can read this small guide to migrate from the 0.6 to the 1.0 version: https://github.com/letsar/flutter_slidable/wiki/Migration-from-version-0.6.0-to-version-1.0.0

Features

  • Accepts start (left/top) and end (right/bottom) action panes.
  • Can be dismissed.
  • 4 built-in action panes.
  • 2 built-in slide action widgets.
  • 1 built-in dismiss animation.
  • You can easily create custom layouts and animations.
  • You can use a builder to create your slide actions if you want special effects during animation.
  • Closes when a slide action has been tapped (overridable).
  • Closes when the nearest Scrollable starts to scroll (overridable).
  • Option to disable the slide effect easily.

Install

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  flutter_slidable: <latest_version>

In your library add the following import:

import 'package:flutter_slidable/flutter_slidable.dart';

Getting started

Example:

Slidable(
  // Specify a key if the Slidable is dismissible.
  key: const ValueKey(0),

  // The start action pane is the one at the left or the top side.
  startActionPane: ActionPane(
    // A motion is a widget used to control how the pane animates.
    motion: const ScrollMotion(),

    // A pane can dismiss the Slidable.
    dismissible: DismissiblePane(onDismissed: () {}),

    // All actions are defined in the children parameter.
    children: const [
      // A SlidableAction can have an icon and/or a label.
      SlidableAction(
        onPressed: doNothing,
        backgroundColor: Color(0xFFFE4A49),
        foregroundColor: Colors.white,
        icon: Icons.delete,
        label: 'Delete',
      ),
      SlidableAction(
        onPressed: doNothing,
        backgroundColor: Color(0xFF21B7CA),
        foregroundColor: Colors.white,
        icon: Icons.share,
        label: 'Share',
      ),
    ],
  ),

  // The end action pane is the one at the right or the bottom side.
  endActionPane: const ActionPane(
    motion: ScrollMotion(),
    children: [
      SlidableAction(
        // An action can be bigger than the others.
        flex: 2,
        onPressed: doNothing,
        backgroundColor: Color(0xFF7BC043),
        foregroundColor: Colors.white,
        icon: Icons.archive,
        label: 'Archive',
      ),
      SlidableAction(
        onPressed: doNothing,
        backgroundColor: Color(0xFF0392CF),
        foregroundColor: Colors.white,
        icon: Icons.save,
        label: 'Save',
      ),
    ],
  ),

  // The child of the Slidable is what the user sees when the
  // component is not dragged.
  child: const ListTile(title: Text('Slide me')),
),

Motions

Any ActionPane has a motion parameter which allow you to define how the pane animates when the user drag the Slidable.

Behind Motion

The actions appear as if they where behind the Slidable:

Behind Motion

Drawer Motion

Animate the actions as if they were drawers, when the Slidable is moving:

Drawer Motion

Scroll Motion

The actions follow the Slidable while it's moving:

Scroll Motion

Stretch Motion

Animate the actions as if they were streched while the Slidable is moving:

Stretch Motion

FAQ

You can read the FAQ here: https://github.com/letsar/flutter_slidable/wiki/FAQ

Sponsoring

I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

You might also like...

Example of Continuous Delivery with Flutter, Firebase App Distribution, and Github Actions

Example of Continuous Delivery with Flutter, Firebase App Distribution, and Github Actions

Example of Continuous Delivery with Flutter, Firebase App Distribution, and Github Actions

Apr 5, 2022

A Flutter package for simple and easy to use actions like buttons, checkboxes and switches.

A Flutter package for simple and easy to use actions like buttons, checkboxes and switches.

Easy Actions Overview A Flutter package for simple and easy to use actions like buttons, checkboxes and switches. Features Elevated Button Outlined Bu

Jun 25, 2022

Made with Clean architecture + TDD + GraphQL + flutter_bloc + CodeCov + GitHooks + GitHub Actions (CI/CD) and finally with πŸ’™

Made with Clean architecture + TDD + GraphQL + flutter_bloc + CodeCov + GitHooks + GitHub Actions (CI/CD) and finally with πŸ’™

Rick and Morty Info A simple app to demonstrate Clean Architecture with GraphQL and flutter_bloc Motivation In Martin Fowler's words, β€œAny fool can wr

Dec 25, 2022

Flutter Slides utilizes Flutter Desktop Embedding to provide a simple slide presentation app

Flutter Slides utilizes Flutter Desktop Embedding to provide a simple slide presentation app

Flutter Slides Flutter Slides utilizes Flutter Desktop Embedding to provide a simple slide presentation app. Presentations are data driven from files

Oct 31, 2022

A slide puzzle game created with flutter for the flutter hack

A slide puzzle game created with flutter for the flutter hack

Jungle puzzle A slide puzzle game created with flutter for the flutter hack https://flutter.dev/events/puzzle-hack Numeric Image Dark Mode How to run?

Oct 26, 2022

Apparence.io flutter slide puzzle challenge

Apparence.io flutter slide puzzle challenge

Slide puzzle flutter challenge 2022 Developed with πŸ’™ by Apparence.io Gameplay This puzzle game is a bit different from other water pipes games. You c

Apr 30, 2022

An Animated login page made with dart which is slide based

An Animated login page made with dart which is slide based

Flutter animated login page A new dart project designed for login page of a webs

Jan 27, 2022

Let's create a selectable Flutter Navigation Drawer with routing that highlights the current item within the Flutter Sidebar Menu.

Let's create a selectable Flutter Navigation Drawer with routing that highlights the current item within the Flutter Sidebar Menu.

Flutter Tutorial - Sidebar Menu & Selectable Navigation Drawer Let's create a selectable Flutter Navigation Drawer with routing that highlights the cu

Dec 26, 2022

Item Selector for Flutter

Item Selector for Flutter

Item Selector for Flutter A generic Flutter item selector that works with ListView, GridView, Row, Column, or basically any parent widget that can hav

Sep 28, 2022
Owner
Sardor Makhmudov
Flutter Mobile Developer
Sardor Makhmudov
Slide puzzle - A slide puzzle built for Flutter Challenge

Slide Puzzle A slide puzzle built for Flutter Challenge. Built by Very Good Vent

Very Good Ventures 494 Dec 30, 2022
A simple slide-to-unlock widget for Flutter inspired by the Android Slide To Act.

Flutter Slide To Act A simple slide-to-unlock widget for Flutter inspired by the Android Slide To Act. Getting started Add slide_to_act to your pubspe

Salvatore Giordano 79 Dec 25, 2022
Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map.

Custom Radio Group List Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map. Feature

Ashok Kumar Verma 0 Nov 30, 2021
Flutter page widget that is dismissed by swipe gestures, with Hero style animations, Inspired by Facebook and Instagram stories.

dismissible_page ?? ?? Creates page that is dismissed by swipe gestures, with Hero style animations, Inspired by FB, IG stories. Live Demo Contents Su

Tornike 76 Dec 22, 2022
Responsive Scaffold - On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item. Maintainer: @rodydavis

responsive_scaffold View the online demo here! On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item.

Flutter Community 346 Dec 2, 2022
A flutter list view which can drag & move item to change order.

draggable_flutter_list A flutter list view which can drag & move item to change order. some codes come from flutter_list_drag_and_drop fix flutter_lis

刘彦博 40 Sep 22, 2022
:bug: Flutter debug helper widget with common and custom actions

Debug Friend Flutter debug helper widget with common and custom actions This helps you reduce the development and testing time of new features Show so

Stanislav Ilin 43 Dec 7, 2022
A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!

Ravi Kavaiya 89 Dec 8, 2022
Flutter Bidirectional ListView - ListView with items that can be scrolled in both directions with a fixed item count and scroll boundaries.

Flutter Bidirectional ListView ListView with items that can be scrolled and lazy loaded in up and down direction with a fixed item count and scroll bo

Christoph Rothermel 7 May 30, 2022
First Flutter Project using StateFull,Important Widgets,proberties,actions

first_project A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Ahmed Hossny 1 Jan 8, 2022