BeforeAfter constructor

BeforeAfter({
  1. Key? key,
  2. required Widget before,
  3. required Widget after,
  4. double? height,
  5. double? width,
  6. double? trackWidth,
  7. Color? trackColor,
  8. bool hideThumb = false,
  9. double? thumbHeight,
  10. double? thumbWidth,
  11. Color? thumbColor,
  12. WidgetStateProperty<Color?>? overlayColor,
  13. BoxDecoration? thumbDecoration,
  14. SliderDirection direction = SliderDirection.horizontal,
  15. double value = 0.5,
  16. int? divisions,
  17. ValueChanged<double>? onValueChanged,
  18. double thumbPosition = 0.5,
  19. int? thumbDivisions,
  20. ValueChanged<double>? onThumbPositionChanged,
  21. MouseCursor? mouseCursor,
  22. FocusNode? focusNode,
  23. bool autofocus = false,
})

Creates a BeforeAfter widget with the specified before and after images.

Implementation

BeforeAfter({
  super.key,
  required this.before,
  required this.after,
  this.height,
  this.width,
  this.trackWidth,
  this.trackColor,
  this.hideThumb = false,
  this.thumbHeight,
  this.thumbWidth,
  this.thumbColor,
  this.overlayColor,
  this.thumbDecoration,
  this.direction = SliderDirection.horizontal,
  this.value = 0.5,
  this.divisions,
  this.onValueChanged,
  this.thumbPosition = 0.5,
  this.thumbDivisions,
  this.onThumbPositionChanged,
  this.mouseCursor,
  this.focusNode,
  this.autofocus = false,
})  : assert(thumbDecoration == null || thumbDecoration.debugAssertIsValid()),
      assert(
        thumbColor == null || thumbDecoration == null,
        'Cannot provide both a thumbColor and a thumbDecoration\n'
        'To provide both, use "thumbDecoration: BoxDecoration(color: thumbColor)".',
      );