Switcher constructor

const Switcher({
  1. Key? key,
  2. required ValueChanged<bool> onChanged,
  3. bool open = false,
  4. bool enable = true,
  5. double width = 45,
  6. Color onColor = const Color(0xFF26B85C),
  7. Widget? onChild,
  8. Color offColor = const Color(0xFFCCCCCC),
  9. Widget? offChild,
  10. Color? sliderColor,
  11. Widget? sliderChild,
  12. List<BoxShadow>? boxShadow,
})

Implementation

const Switcher({
  Key? key,
  required this.onChanged,
  this.open = false,
  this.enable = true,
  this.width = 45,
  //
  this.onColor = const Color(0xFF26B85C),
  this.onChild,
  this.offColor = const Color(0xFFCCCCCC),
  this.offChild,
  //
  this.sliderColor,
  this.sliderChild,
  //
  this.boxShadow,
})  : height = width * 0.5,
      offset = width * 0.5 / 18,
      childOffset = width * 0.5 / 5,
      super(key: key);