control_widget 0.0.1 copy "control_widget: ^0.0.1" to clipboard
control_widget: ^0.0.1 copied to clipboard

Package for make widget controllable.

Package for make widget controllable

Alt Text

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"),
		),
	),
	);

Full /example

Finally, feel free to contribute or suggest any idea 💡

2
likes
140
pub points
10%
popularity

Publisher

verified publisherbixat.dev

Package for make widget controllable.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on control_widget