movedPathHint function

String? movedPathHint(
  1. String path
)

What to write now instead of a binding path path 30.1.0 moved (as 30.0.0 spelled it), or null when it is not one: in 30.1.0 the node's scale and layout.rotation are in motion, flightKey and flight in hero; strokePath and props.subpathColors are customPaint path ops, a box's props.path a path node's props.data. A path an action or a condition names in a schema-2 document is rewritten by the migration; one that comes from elsewhere at run time (another document, a script) is refused where it is used, with this.

Implementation

String? movedPathHint(String path) {
  final p = path.trim();
  return switch (p) {
    'scale' => '"motion.scale" (the node\'s Transform.scale is its motion; 30.0.0 multiplied the two)',
    'layout.rotation' => '"motion.rotate" (the node\'s Transform.rotate is its motion; 30.0.0 added the two)',
    'flightKey' => '"hero.tag" on a hero that flies "inPlace" ({"hero": {"tag": ..., "flies": "inPlace"}})',
    _ when p.startsWith('flight.') || p == 'flight' => '"hero.$p" (how the hero flies in place)',
    _ when p == 'strokePath' || p.startsWith('strokePath.') =>
      'a variable bound into the "customPaint" path op that draws the line ("points", "trimEnd" for the progress, "paint.color")',
    'props.path' => '"props.data" (a box drawn as a path is a path node)',
    'props.subpathColors' => 'a variable bound into the paint of each "customPaint" path op (one op per color)',
    'props.use24h' => '"props.alwaysUse24HourFormat" (a time picker\'s 24-hour dial, Flutter\'s name)',
    _ => specialPathHint(p),
  };
}