0 purchases
control widget
Package for make widget controllable
Features #
✅ Move widget (onMove & onEndMove)
✅ Resize widget (onResize & onEndResize)
✅ Resize & Move (onUpdate & onEndUpdate)
❌ Rotate widget (onRotate & onEndRotate)
❌ Add max/min size
❌ Add max/min offset
❌ Add max/min rotate
Getting started #
It's required to use ControllableWidget inside of Stack widget
Usage #
ControllableWidget(
height: height,
width: width,
left: left,
top: top,
onResize: (Size newSize) {
print("Size:$newSize");
height = newSize.height;
width = newSize.width;
},
onMove: (newOffset) {
print("Offset:$newOffset");
left = newOffset.dx;
top = newOffset.dy;
},
onEndResize: (newSize) {
print("Size End :$newSize");
height = newSize.height;
width = newSize.width;
},
onEndMove: (newOffset) {
print("Offset End :$newOffset");
left = newOffset.dx;
top = newOffset.dy;
},
child: ColoredBox(
color: Colors.blue,
child: Center(
child: Text("Item $index"),
),
),
);
copied to clipboard
Full /example
Finally, feel free to contribute or suggest any idea 💡
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.