Slide To Widget Flutter Tutorial

Akhil George
Apr 8, 2023

--

We will discuss about how to implement slide-to-action in our Flutter app in this short article.

Implementation

  • Add dependencies to pubspec.yaml file.

package: slide_to_act

slide_to_act: ^2.0.1
  • Import package
import 'package:slide_to_act/slide_to_act.dart';
  • Create Slide To Action Widget Using SlideAction()
SlideAction(
borderRadius: 12,
elevation: 0,
innerColor: Colors.amber,
outerColor: Colors.amber.shade100,
sliderButtonIcon: Icon(
Icons.attach_money,
),
text: "Slide to Pay",
sliderRotate: false,
textStyle: TextStyle(color: Colors.grey, fontSize: 25),
onSubmit: () {
//do something
},
),

output :

SwipeAction widget without decorations
Before Swipe
After Swipe

Thanks :)

--

--