RollingSwitch.widget constructor
const
RollingSwitch.widget({
- Key? key,
- required dynamic onChanged(),
- RollingWidgetInfo rollingInfoRight = const RollingWidgetInfo(),
- RollingWidgetInfo rollingInfoLeft = const RollingWidgetInfo(backgroundColor: Colors.grey),
- bool initialState = false,
- double width = 130,
- double height = 50,
- double innerSize = 40,
- Color circularColor = Colors.white,
- bool enableDrag = false,
- Duration animationDuration = const Duration(milliseconds: 400),
- Function? onTap,
Implementation
const RollingSwitch.widget({
Key? key,
required this.onChanged,
RollingWidgetInfo rollingInfoRight = const RollingWidgetInfo(),
RollingWidgetInfo rollingInfoLeft = const RollingWidgetInfo(
backgroundColor: Colors.grey,
),
this.initialState = false,
this.width = 130,
this.height = 50,
this.innerSize = 40,
this.circularColor = Colors.white,
this.enableDrag = false,
this.animationDuration = const Duration(milliseconds: 400),
this.onTap,
}) : assert(height >= 50.0 && innerSize >= 40.0),
rollingInfoLeft = rollingInfoLeft,
rollingInfoRight = rollingInfoRight,
super(key: key);