Anchor.forPos constructor
Implementation
factory Anchor.forPos(AnchorPos<dynamic>? pos, double width, double height) {
if (pos == null) return Anchor._(width, height, AnchorAlign.none);
if (pos.value is AnchorAlign) {
return Anchor._(width, height, pos.value as AnchorAlign);
}
if (pos.value is Anchor) return pos.value as Anchor;
throw Exception('Unsupported AnchorPos value type: ${pos.runtimeType}.');
}