FloatingDraggableWidget class
Support Android, IOS, Web etc. This package is used to make a widget movable or draggable around the screen freely; Works fine for any Widget; Does not affect the functionality or performance of the particular widget; Used physics law supported animation to make it more attractive;
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FloatingDraggableWidget
Constructors
- FloatingDraggableWidget({Key? key, required Widget mainScreenWidget, required Widget floatingWidget, required double floatingWidgetWidth, required double floatingWidgetHeight, double? dy, double? dx, double? screenHeight, double? screenWidth, double? speed, Widget? deleteWidget, dynamic onDeleteWidget()?, double? bottom, bool isDraggable = true, bool autoAlign = false, AlignmentGeometry deleteWidgetAlignment = Alignment.bottomCenter, int deleteWidgetAnimationDuration = 200, int hasDeleteWidgetAnimationDuration = 300, Curve deleteWidgetAnimationCurve = Curves.easeIn, double deleteWidgetHeight = 50, double deleteWidgetWidth = 50, double isCollidingDeleteWidgetHeight = 70, double isCollidingDeleteWidgetWidth = 70, BoxDecoration? deleteWidgetDecoration, EdgeInsets? deleteWidgetPadding = const EdgeInsets.only(bottom: 8), bool resizeToAvoidBottomInset = true, dynamic onDragging(bool)?, Widget? widgetWhenDragging})
Properties
- autoAlign → bool
-
final
- bottom → double?
-
final
- deleteWidget → Widget?
-
final
- deleteWidgetAlignment → AlignmentGeometry
-
final
- deleteWidgetAnimationCurve → Curve
-
final
- deleteWidgetAnimationDuration → int
-
final
- deleteWidgetDecoration → BoxDecoration?
-
final
- deleteWidgetHeight → double
-
final
- deleteWidgetPadding → EdgeInsets?
-
final
- deleteWidgetWidth → double
-
final
- dx → double?
-
final
- dy → double?
-
final
- floatingWidget → Widget
-
final
- floatingWidgetHeight → double
-
final
- floatingWidgetWidth → double
-
final
- hasDeleteWidgetAnimationDuration → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCollidingDeleteWidgetHeight → double
-
final
- isCollidingDeleteWidgetWidth → double
-
final
- isDraggable → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainScreenWidget → Widget
-
mainScreenWidget is required and it accept any widget.
This is actually the base Widget or the parent widget on where the floating widget will be dragged or moved.
floatingWidget is also required and it accept any widget.
This is actually the particular widget which will be floated and can be mode or dragged around the screen.
floatingWidgetWidth is also required and it accepts a double value which is the width of the floating widget above mentioned.
floatingWidgetHeight is also required and it accepts a double value which is the height of the floating widget above mentioned.
dy accepts a double value which is the distance from the top of the screen where floating widget will be positioned initially .
dx accepts a double value which is the distance from the left of the screen where floating widget will be positioned initially.
screenHeight accepts a double value which is the height of the screen initially.
screenWidth accepts a double value which is the width of the screen initially.
speed accepts a double value which is the speed factor of the floating widget after it will be let go.
The more speed will be provided the slower the object will move after the user let the widget go freely.
isDraggable accepts a boolean value which is used to make the floating widget draggable or not.
autoAlign accepts a boolean value which is used to make the floating widget auto align.
deleteWidget accepts a widget which is used to delete the floating widget.
onDeleteWidget accepts a function which is used to delete the floating widget.
deleteWidgetAlignment accepts an alignment value which is used to align the delete widget.
deleteWidgetAnimationCurve accepts an animation curve value which is used to animate the delete widget.
deleteWidgetAnimationDuration accepts an animation duration value which is used to animate the delete widget
hasDeleteWidgetAnimationDuration accepts an animation duration value which is used to animate the delete widget
when it is dragging with the delete widget.
deleteWidgetHeight accepts a double value which is used to set the height of the delete widget.
deleteWidgetWidth accepts a double value which is used to set the width of the delete widget.
isCollidingDeleteWidgetHeight accepts a double value which is used to set the height of the delete widget.
isCollidingDeleteWidgetWidth accepts a double value which is used to set the width of the delete widget.
boxDecoration optionally accepts a box decoration value which is used to set the decoration of the delete widget.
deleteWidgetPadding optionally accepts a padding value which is used to set the padding of the delete widget.
final
- onDeleteWidget → (dynamic Function()?)
-
final
- onDragging → (dynamic Function(bool)?)
-
onDragging optionally accepts a function which is used to notify the user when the widget is dragging.
final
- resizeToAvoidBottomInset ↔ bool
-
If the user need disable the resizeToAvoidBottomInset from Scaffold.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenHeight → double?
-
final
- screenWidth → double?
-
final
- speed → double?
-
final
- widgetWhenDragging → Widget?
-
widgetWhenDragging optionally accepts a widget which is used to show when the widget is dragging.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FloatingDraggableWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited