alignment static method
Implementation
static Alignment? alignment(dynamic value) {
if (value is String) {
return switch (value) {
'topLeft' => Alignment.topLeft,
'topCenter' => Alignment.topCenter,
'topRight' => Alignment.topRight,
'centerLeft' => Alignment.centerLeft,
'center' => Alignment.center,
'centerRight' => Alignment.centerRight,
'bottomLeft' => Alignment.bottomLeft,
'bottomCenter' => Alignment.bottomCenter,
'bottomRight' => Alignment.bottomRight,
_ => _parsePointInString(value),
};
}
if (value is Map) {
return _toAlignmentFromPoint(value['x'], value['y']);
}
return null;
}