FloatingController class
Controller for managing the state and behavior of a floating widget.
- Inheritance
-
- Object
- ChangeNotifier
- FloatingController
Constructors
- FloatingController(BuildContext context, {double collapsedHeight = 170, bool isDraggable = false, double topMargin = 75, double bottomMargin = 20, double padding = 20, FloatingPosition initialPosition = FloatingPosition.bottomRight})
- Creates a FloatingController with the given parameters.
Properties
- bottomMargin → double
-
The margin from the bottom of the screen.
final
- collapsedHeight → double
-
The height of the floating widget when it is collapsed.
final
- collapsedSize → Size
-
The size of the floating widget when it is collapsed.
no setter
- context → BuildContext
-
The BuildContext used to access MediaQuery data.
final
- hasChild → bool
-
Whether the floating widget has both minimized and maximized children.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialPosition → FloatingPosition
-
The initial position of the floating widget.
final
- isCollapsed → bool
-
Whether the floating widget is currently collapsed.
no setter
- isDraggable → bool
-
Controls whether the floating widget can be moved by the user.
final
- isMoving → bool
-
Whether the floating widget is currently being moved.
no setter
- maximizedChild → Widget?
-
The widget to display when the floating widget is maximized.
no setter
- minimizedChild → Widget?
-
The widget to display when the floating widget is minimized.
no setter
- padding → double
-
The padding around the floating widget.
final
- position ↔ Offset
-
The current position of the floating widget.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenSize → Size
-
The size of the screen.
no setter
- topMargin → double
-
The margin from the top of the screen.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
close(
) → void - Closes the floating widget and cleans up resources.
-
dispose(
) → void -
Disposes the floating widget and cleans up resources.
override
-
initialize(
{required Widget maxChild, required Widget minChild, required VoidCallback onDispose}) → void - Initializes the floating widget with the given children and dispose callback.
-
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
-
snapToCorner(
) → void - Snaps the floating widget to the nearest corner.
-
toggleMoving(
) → void - Toggles the moving state of the floating widget.
-
toggleSize(
) → void - Toggles the size of the floating widget between collapsed and expanded.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited