SheetController class

Controls a PinnedSheet: reads its current position and drives it to a SheetStage.

The controller is a ChangeNotifier that notifies whenever the sheet's position changes. stage returns a live stage that can be compared against derived stages:

final controller = SheetController();
...
PinnedSheet(controller: controller, child: ...);
...
controller.stage = SheetStage.expanded();
controller.animateTo(SheetStage.fixed(120),
    duration: kDefaultDuration, curve: Curves.easeOut);
if (controller.stage == (SheetStage.expanded() - SheetStage.fixed(100))) { ... }
Inheritance

Constructors

SheetController()

Properties

fraction double
The current visible extent of the sheet, as a fraction (0..1) of its axis.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAttached bool
Whether this controller is attached to a live PinnedSheet.
no setter
isOpen bool
Whether the sheet is showing at all.
no setter
offset double
The current visible extent of the sheet, in logical pixels.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stage SheetStage
The current position as a live stage that can be compared against other (possibly derived) stages using ==.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
animateTo(SheetStage stage, {Duration duration = kDefaultDuration, Curve curve = Curves.linear}) Future<void>
Animates the sheet to stage.
close({Duration duration = kDefaultDuration, Curve curve = Curves.easeOut}) Future<void>
Animates the sheet fully closed (SheetStage.closed).
dispose() → void
Discards any resources used by the object.
inherited
jumpTo(SheetStage stage) → void
Immediately jumps the sheet to stage with no animation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
open({Duration duration = kDefaultDuration, Curve curve = Curves.easeOut}) Future<void>
Animates the sheet fully open (SheetStage.expanded).
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