ImageCompareSlider class

// Haptic feedback type. A Flutter widget that allows you to compare two images.

Usage:

 ImageCompareSlider(
   itemOne: const Image.asset('...'),
   itemTwo: const Image.asset('...'),
 )

See also:

Inheritance

Constructors

ImageCompareSlider({required Image itemOne, required Image itemTwo, Key? key, Widget itemOneBuilder(Widget child, BuildContext context)?, Widget itemTwoBuilder(Widget child, BuildContext context)?, bool changePositionOnHover = false, void onPositionChange(double position)?, double position = 0.5, Color dividerColor = Colors.white, double dividerWidth = 2.5, Size handleSize = const Size(20, 20), BorderRadius handleRadius = const BorderRadius.all(Radius.circular(10)), bool fillHandle = false, bool hideHandle = false, double handlePosition = 0.5, bool handleFollowsPosition = false, SliderDirection direction = SliderDirection.leftToRight, BorderRadiusGeometry photoRadius = BorderRadius.zero})
Creates a ImageCompareSlider.
const

Properties

changePositionOnHover bool
Whether the slider should follow the pointer on hover.
final
direction SliderDirection
Direction of the slider.
final
dividerColor Color
Color of the divider
final
dividerWidth double
Width of the divider
final
fillHandle bool
Wether to fill the handle.
final
handleFollowsPosition bool
Wheter or not the handle should follow the position while dragging.
final
handlePosition double
Where to place the handle.
final
handleRadius BorderRadius
Handle radius.
final
handleSize Size
Handle size.
final
hashCode int
The hash code for this object.
no setterinherited
hideHandle bool
Whether to hide the handle.
final
itemOne Image
First component to show in slider.
final
itemOneBuilder Widget Function(Widget child, BuildContext context)?
Wrapper for the first component.
final
itemTwo Image
Second component to show in slider.
final
itemTwoBuilder Widget Function(Widget child, BuildContext context)?
Wrapper for the second component.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPositionChange → void Function(double position)?
Callback on position change, returns current position.
final
photoRadius BorderRadiusGeometry
Radius of the photo.
final
portrait bool
Whether to use portrait orientation.
final
position double
Initial percentage position of divide (0-1).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ImageCompareSlider>
Whether to only handle drag events on the handle. Whether to enable haptic feedback. Type of haptic feedback.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited