encodeTextAlign static method
Encodes the given value
to the String representation. Supported values
are:
center
end
justify
left
right
start
All other values, including null
, will result in null
.
Implementation
static String? encodeTextAlign(TextAlign? value) {
String? result;
if (value != null) {
switch (value) {
case TextAlign.center:
result = 'center';
break;
case TextAlign.end:
result = 'end';
break;
case TextAlign.justify:
result = 'justify';
break;
case TextAlign.left:
result = 'left';
break;
case TextAlign.right:
result = 'right';
break;
case TextAlign.start:
result = 'start';
break;
}
}
return _stripDynamicNull(result);
}