MagneticButton class
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 setter inherited
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.
final inherited
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 setter inherited
width
→ double ?
The width of the magnetic widget. This is an optional parameter.
final