MenuController class
Controls the animation and state of a single SideDrawer.
- Inheritance
-
- Object
- ChangeNotifier
- MenuController
Constructors
- MenuController(SideDrawer _drawer, dynamic onAnimated(double), {required TickerProvider vsync, BuildContext? context})
- Constructor for MenuController.
Properties
- contentScale ↔ double
-
Calculated slide amount in pixels.
getter/setter pair
- duration ↔ Duration
-
The duration of the drawer animation.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- onAnimated → dynamic Function(double)
-
Callback function invoked when the animation value changes.
final
- percentOpen → dynamic
-
Returns the current value of the animation controller, representing the open percentage.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scalePercent → double
-
Getter for the current scale percentage.
no setter
- slideAmount ↔ double
-
Calculated slide amount in pixels.
getter/setter pair
- slidePercent → double
-
Getter for the current slide percentage.
no setter
- state ↔ MenuState
-
The current state of the menu (closed, opening, open, closing).
getter/setter pair
- value ↔ dynamic
-
The currently selected value or item ID associated with this drawer.
getter/setter pair
- vsync → TickerProvider
-
The TickerProvider for the animation controller.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
calculate(
BuildContext? context) → dynamic -
Calculates the
slideAmountandcontentScalebased on the current animation state. -
close(
) → Future< void> - Initiates the animation to close the drawer.
-
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).
override
-
isOpen(
) → dynamic - Checks if the drawer is fully open.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
open(
) → Future< void> - Initiates the animation to open the drawer.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toggle(
) → Future< void> - Toggles the drawer state (opens if closed, closes if open).
-
toString(
) → String -
A string representation of this object.
inherited
-
updateValue(
dynamic value) → dynamic - Updates the selected value and notifies listeners.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited