RollingSwitch.widget constructor

const RollingSwitch.widget({
  1. Key? key,
  2. required dynamic onChanged(
    1. bool
    ),
  3. RollingWidgetInfo rollingInfoRight = const RollingWidgetInfo(),
  4. RollingWidgetInfo rollingInfoLeft = const RollingWidgetInfo(backgroundColor: Colors.grey),
  5. bool initialState = false,
  6. double width = 130,
  7. double height = 50,
  8. double innerSize = 40,
  9. Color circularColor = Colors.white,
  10. bool enableDrag = false,
  11. Duration animationDuration = const Duration(milliseconds: 400),
  12. 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);