dock static method

MagneticSim dock({
  1. required double position0,
  2. required double target,
})

Dock behavior — used for element snapping to grid/anchor points.

Implementation

static MagneticSim dock({
  required double position0,
  required double target,
}) =>
    MagneticSim(
      position0: position0,
      target: target,
      strength: 60.0,
      restThreshold: 0.5,
    );