Skip to content

Flutter widget that swaps children with each other in slide animation.

License

Notifications You must be signed in to change notification settings

zuvola/flutter_slide_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_slide_swap

Flutter widget that swaps children with each other in slide animation.

pub package

Getting Started

To use this plugin, add flutter_slide_swap as a dependency in your pubspec.yaml file.

dependencies:
 flutter_slide_swap: 

Import the library in your file.

import 'package:flutter_slide_swap/flutter_slide_swap.dart';

See the example directory for a complete sample app using SlideSwap. Or use the SlideSwap like below.

var _controller = SlideController(length: 4);
SlideSwap(
  controller: _controller,
  children: <Widget>[
    RaisedButton(
      key: keyA,
      onPressed: () {
        _controller.swapOrder(0, 1);
      },
      child: Text('A'),
    ),
    RaisedButton(
      key: keyB,
      onPressed: () {
        _controller.swapWithKey(keyA, keyB);
      },
      child: Text('B'),
    ),
  ],
)

About

Flutter widget that swaps children with each other in slide animation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published