MagneticButton class

Inheritance

Constructors

MagneticButton({Key? key, required Widget child, double mx = 0.2, double my = 0.2, Duration duration = const Duration(milliseconds: 200), Curve curve = Curves.easeOutCirc, double? height, double? width, EdgeInsets? padding, bool mobile = true, ValueChanged<Offset>? onChanged, double distance = 0.7})
const

Properties

child Widget
final
curve Curve
The curve of the animation.
final
distance double
Determines the proximity at which an animation for a widget is initiated. Default value is 70% of the width of the render box.
final
duration Duration
The duration of the animation.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height of the magnetic widget. This is an optional parameter.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mobile bool
A boolean value indicating whether the widget should respond to long press events on mobile. If false only Web will work.
final
mx double
This is the horizontal offset of the magnetic widget. It determines how much the button moves in the horizontal direction (left or right) when it’s being interacted with. A larger value will result in a greater horizontal movement.
final
my double
This is the vertical offset of the magnetic widget. It controls how much the button moves in the vertical direction (up or down) during interaction. A larger value will result in a greater vertical movement
final
onChanged ValueChanged<Offset>?
A nullable callback function called when an Offset change event occurs.
final
padding EdgeInsets?
The padding around the magnetic widget. This is an optional parameter.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double?
The width of the magnetic widget. This is an optional parameter.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MagneticButton>
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