RollingSwitch.icon constructor

const RollingSwitch.icon({
  1. Key? key,
  2. required dynamic onChanged(
    1. bool
    ),
  3. RollingIconInfo rollingInfoRight = const RollingIconInfo(icon: Icons.flag),
  4. RollingIconInfo rollingInfoLeft = const RollingIconInfo(icon: Icons.check, 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.icon({
  Key? key,
  required this.onChanged,
  RollingIconInfo rollingInfoRight = const RollingIconInfo(
    icon: Icons.flag,
  ),
  RollingIconInfo rollingInfoLeft = const RollingIconInfo(
    icon: Icons.check,
    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);