Anchor.forPos constructor

Anchor.forPos(
  1. AnchorPos pos,
  2. double width,
  3. double height
)

Implementation

factory Anchor.forPos(AnchorPos pos, double width, double height) {
  if (pos == null) return Anchor._(width, height, null);
  if (pos.value is AnchorAlign) return Anchor._(width, height, pos.value);
  if (pos.value is Anchor) return pos.value;
  throw Exception('Unsupported AnchorPos value type: ${pos.runtimeType}.');
}