DraggableScrollableController class Null safety

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()

Properties

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

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).
mustCallSuper">@mustCallSuperinherited
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 non-existent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
protected">@protectedvisibleForTesting">@visibleForTestinginherited
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