resolve method Null safety
- TextDirection? direction
override
Convert this instance into a BorderRadius, so that the radii are expressed for specific physical corners (top-left, top-right, etc) rather than in a direction-dependent manner.
See also:
- BorderRadius, for which this is a no-op (returns itself).
- BorderRadiusDirectional, which flips the horizontal direction
based on the
direction
argument.
Implementation
@override
BorderRadius resolve(TextDirection? direction) {
assert(direction != null);
switch (direction!) {
case TextDirection.rtl:
return BorderRadius.only(
topLeft: topEnd,
topRight: topStart,
bottomLeft: bottomEnd,
bottomRight: bottomStart,
);
case TextDirection.ltr:
return BorderRadius.only(
topLeft: topStart,
topRight: topEnd,
bottomLeft: bottomStart,
bottomRight: bottomEnd,
);
}
}