BorderRadiusGeometry.horizontal constructor
Creates a horizontally symmetrical border radius.
Utilizing the left
and right
properties will return a BorderRadius,
while start
and end
will yield a BorderRadiusDirectional. These
properties cannot be used interchangeably.
Implementation
factory BorderRadiusGeometry.horizontal({
Radius? left, // BorderRadius
Radius? right, // BorderRadius
Radius? start, // BorderRadiusDirectional
Radius? end, // BorderRadiusDirectional
}) {
assert(
(left == null && right == null) || (start == null && end == null),
'The left and right values cannot be used in conjunction with start and end.',
);
if (start != null || end != null) {
return BorderRadiusDirectional.horizontal(
start: start ?? Radius.zero,
end: end ?? Radius.zero,
);
}
return BorderRadius.horizontal(left: left ?? Radius.zero, right: right ?? Radius.zero);
}