Compares two images. The slider is interactive and can be dragged left and right.
/// The Diff component is a stateful wrapper that requires `DiffItem1`
/// and `DiffItem2` to be passed as direct children.
Diff(
[
DiffItem1([
img(src: '/images/flower2.jpg'),
]),
DiffItem2([
img(src: '/images/flower2.jpg'),
]),
],
// Applying sizing and effects for a better presentation.
style: [Size.w96, Size.h96, Effects.roundedBox],
)
Diff with text
You can compare any two elements. This example uses styled Containers to hold text.