BeforeAfter constructor
BeforeAfter({
- Key? key,
- required Widget before,
- required Widget after,
- double? height,
- double? width,
- double? trackWidth,
- Color? trackColor,
- bool hideThumb = false,
- double? thumbHeight,
- double? thumbWidth,
- Color? thumbColor,
- WidgetStateProperty<
Color?> ? overlayColor, - BoxDecoration? thumbDecoration,
- SliderDirection direction = SliderDirection.horizontal,
- double value = 0.5,
- int? divisions,
- ValueChanged<
double> ? onValueChanged, - double thumbPosition = 0.5,
- int? thumbDivisions,
- ValueChanged<
double> ? onThumbPositionChanged, - MouseCursor? mouseCursor,
- FocusNode? focusNode,
- 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)".',
);