A controller widget is a widget that controls other widgets in the widget pool. The HeaderController widget in the FoldableTheme is an example of a controller widget. A controller widget is usually added as part of a theme.
The controller widget can be created in the same way as other widgets with the following additions:
- Add the jimu/PoolControllerMixin class.
This class provides the following methods:
Returns all the widgets configured in the widget pool and does not include any widgets in the group.
Returns all the groups configured in the widget pool.
Returns all the groups and widgets configured in the widget pool.
Gets the config section by ID.
In the Builder environment, the class also provides the following methods to override if needed:
Returns IDs for all open widgets and groups.
Opens the widgets and groups defined by the parameter.
- Create a control menu based on the configuration in the widget pool.
There are two types of widgets: in-panel and off-panel. Be sure to open the widget correctly.