plinth_hooks 1.1.0 copy "plinth_hooks: ^1.1.0" to clipboard
plinth_hooks: ^1.1.0 copied to clipboard

Reusable stateful controllers for Plinth UI (equivalent to Mantine's @mantine/hooks).

plinth_hooks #

Reusable stateful controllers for Plinth UI — the equivalent of Mantine's @mantine/hooks.

Usage #

final _modal = PlinthDisclosureController();

// Later, in a widget:
PlinthButton(onPressed: _modal.open, child: const Text('Open'));

// Always dispose it, same as any ChangeNotifier:
@override
void dispose() {
  _modal.dispose();
  super.dispose();
}

What's in this package #

  • PlinthDisclosureController — a ChangeNotifier-based open/closed state controller (open(), close(), toggle(), isOpen). Drives every controller-based overlay in plinth_componentsPlinthModal, PlinthDrawer, PlinthPopover, and PlinthMenu all take one of these to manage their visibility, so a single controller can coordinate a trigger button and the overlay it opens.

See the full documentation for the complete component reference and a live example app.

0
likes
160
points
450
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Reusable stateful controllers for Plinth UI (equivalent to Mantine's @mantine/hooks).

Repository (GitHub)
View/report issues

Topics

#hooks #state-management #ui

License

MIT (license)

Dependencies

flutter

More

Packages that depend on plinth_hooks