Skip to content

aCodeMechanic/swipe_actions_new

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swipe Actions New

swipe_actions_new

A widget which can be used to call functions when the wrapped child is dragged or flung. Only intended to work with horizontal swipes. Original Library: Swipe Actions

Getting Started

Import the package

import 'package:swipe_actions_new/swipe_actions_new.dart';

And use Swipe class, for example:

Swipe(
child: ListTile(
      title: Text("Some Child"),
    ),
    menuItems: <SwipeAction>[
      SwipeAction(
        icon: Icons.add,
        onSelect: () {
          setState(() {
            _counts[i]++;
          });
        },
        highlighColor: Colors.green,
      ),
      SwipeAction(
        icon: Icons.remove,
        onSelect: () {
          setState(() {
            _counts[i]--;
          });
        },
        highlighColor: Colors.red,
      ),
      SwipeAction(
        icon: Icons.open_in_new,
        onSelect: () {
          Navigator.push(
            context,
            MaterialPageRoute(
                builder: (context) => Scaffold(
                      appBar: AppBar(
                        title: Text("Counter $i"),
                      ),
                      body: Center(
                          child: Text(
                        _counts[i].toString(),
                        style: TextStyle(fontSize: 100),
                      )),
                    )),
          );
        },
        highlighColor: Colors.yellow,
      )
    ],
)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages