slider button
this package provides an easy implementation of a slider button to cancel current transaction or screen. highly customizable iphone alike looking widget.
how to use
type 1
this is a circle type widget.
you just need to define the border radius to swap between rectangle and circle type widget.
import 'package:slider_button/slider_button.dart';
center(child: sliderbutton(
action: () {
///do something here
navigator.of(context).pop();
},
label: text(
"slide to cancel event",
style: textstyle(
color: color(0xff4a4a4a), fontweight: fontweight.w500, fontsize: 17),
),
icon: text(
"x",
style: textstyle(
color: colors.white,
fontweight: fontweight.w400,
fontsize: 44,
),
),
));
type 2
this is a rectangle type widget.
import 'package:slider_button/slider_button.dart';
sliderbutton(
action: () {
///do something here onslide
},
///put label over here
label: text(
"slide to cancel !",
style: textstyle(
color: color(0xff4a4a4a),
fontweight: fontweight.w500,
fontsize: 17),
),
icon: center(
child: icon(
icons.power_settings_new,
color: colors.white,
size: 40.0,
semanticlabel: 'text to announce in accessibility modes',
)),
///change all the color and size from here.
width: 230,
radius: 10,
buttoncolor: color(0xffd60000),
backgroundcolor: color(0xff534bae),
highlightedcolor: colors.white,
basecolor: colors.red,
);
Comments are closed.