parseAlignmentGeometry function
Implementation
AlignmentGeometry? parseAlignmentGeometry(String? value) {
if (value != null && value.isNotEmpty) {
switch (value) {
case 'topLeft':
return Alignment.topLeft;
case 'topStart':
return AlignmentDirectional.topStart;
case 'topCenter':
return AlignmentDirectional.topCenter;
case 'topEnd':
return AlignmentDirectional.topEnd;
case 'topRight':
return Alignment.topRight;
case 'centerLeft':
return Alignment.centerLeft;
case 'centerStart':
return AlignmentDirectional.centerStart;
case 'center':
return AlignmentDirectional.center;
case 'centerEnd':
return AlignmentDirectional.centerEnd;
case 'centerRight':
return Alignment.centerRight;
case 'bottomLeft':
return Alignment.bottomLeft;
case 'bottomStart':
return AlignmentDirectional.bottomStart;
case 'bottomCenter':
return AlignmentDirectional.bottomCenter;
case 'bottomEnd':
return AlignmentDirectional.bottomEnd;
case 'bottomRight':
return Alignment.bottomRight;
default:
throw Exception(
"Problem parsing AlignmentGeometry "
"value: $value",
);
}
}
return null;
}