DraggableScrollableController class

Controls a DraggableScrollableSheet.

Draggable scrollable controllers are typically stored as member variables in State objects and are reused in each State.build. Controllers can only be used to control one sheet at a time. A controller can be reused with a new sheet if the previous sheet has been disposed.

The controller's methods cannot be used until after the controller has been passed into a DraggableScrollableSheet and the sheet has run initState.

A DraggableScrollableController is a Listenable. It notifies its listeners whenever an attached sheet changes sizes. It does not notify its listeners when a sheet is first attached or when an attached sheet's parameters change without affecting the sheet's current size. It does not fire when pixels changes without size changing. For example, if the constraints provided to an attached sheet change.

Inheritance

Constructors

DraggableScrollableController()
Creates a controller for DraggableScrollableSheet.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAttached bool
Returns Whether any DraggableScrollableController objects have attached themselves to the DraggableScrollableSheet.
no setter
pixels double
Get the current pixel height of the attached sheet.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
Get the current size (as a fraction of the parent height) of the attached sheet.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
animateTo(double size, {required Duration duration, required Curve curve}) Future<void>
Animates the attached sheet from its current size to the given size, a fractional value of the parent container's height.
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
jumpTo(double size) → void
Jumps the attached sheet from its current size to the given size, a fractional value of the parent container's height.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pixelsToSize(double pixels) double
Convert a sheet's pixel height to size (fractional value of parent container height).
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Reset the attached sheet to its initial size (see: DraggableScrollableSheet.initialChildSize).
sizeToPixels(double size) double
Convert a sheet's size (fractional value of parent container height) to pixels.
toString() String
A string representation of this object.
inherited

Operators

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