ExpansibleController class

A controller for managing the expansion state of an Expansible.

This class is a ChangeNotifier that notifies its listeners if the value of isExpanded changes.

This controller provides methods to programmatically expand or collapse the widget, and it allows external components to query the current expansion state.

The controller's expand and collapse methods cause the the Expansible to rebuild, so they may not be called from a build method.

Remember to dispose of the ExpansibleController when it is no longer needed. This will ensure we discard any resources used by the object.

Inheritance

Constructors

ExpansibleController()
Creates a controller to be used with Expansible.controller.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isExpanded bool
Whether the expansible widget built with this controller is in expanded state.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
collapse() → void
Collapses the Expansible that was built with this controller.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
expand() → void
Expands the Expansible that was built with this controller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

maybeOf(BuildContext context) ExpansibleController?
Finds the Expansible from the closest instance of this class that encloses the given context and returns its ExpansibleController.
of(BuildContext context) ExpansibleController
Finds the ExpansibleController for the closest Expansible instance that encloses the given context.