SceneProp.value constructor

SceneProp.value(
  1. String name,
  2. ScenePropKind kind, {
  3. required String of,
  4. Object? defaultValue,
  5. bool animatable = false,
  6. SceneChoices? choices,
  7. String? unit,
  8. double? softMin,
  9. double? softMax,
  10. bool angular = false,
  11. double? identity,
  12. ScenePick? pick,
})

A row of a registered kind (SceneKind), backed by the KindNode's value map rather than a field: the one place a name meets a key.

The editing hints — unit, the soft range, angular — are what the motion side's spec carried for the hand-written kinds; here they ride the row, so the timeline and the inspector read one table.

Implementation

factory SceneProp.value(
  String name,
  ScenePropKind kind, {
  required String of,
  Object? defaultValue,
  bool animatable = false,
  SceneChoices? choices,
  String? unit,
  double? softMin,
  double? softMax,
  bool angular = false,
  double? identity,
  ScenePick? pick,
}) => SceneProp(
  name,
  kind,
  kindName: of,
  defaultValue: defaultValue,
  animatable: animatable,
  choices: choices,
  unit: unit,
  softMin: softMin,
  softMax: softMax,
  angular: angular,
  identity: identity,
  pick: pick,
  read: (n) => (n as KindNode).values[name] ?? defaultValue,
  write: (n, v) => (n as KindNode).values[name] = v,
);