childFitOptions function

Map<SizeFit, String?> childFitOptions(
  1. Node? parent, {
  2. required bool horizontal,
})

Every fit, each with the reason it isn't allowed under parent (null: allowed). With no parent (a top-level node on the board), fixed, hug and fill.

Implementation

Map<SizeFit, String?> childFitOptions(Node? parent, {required bool horizontal}) {
  final rule = parent?.spec?.childFits ?? defaultChildFits;
  return {
    for (final f in SizeFit.values)
      f: parent == null ? (f == SizeFit.flexible ? _flexOnly : null) : rule(parent, f, horizontal),
  };
}