borderRadius static method

BorderRadiusGeometry? borderRadius(
  1. DataSource source,
  2. List<Object> key
)

Returns a BorderRadiusDirectional from the specified list.

The list is a list of values as interpreted by radius. An empty or missing list results in a null return value. The list should have one through four items. Extra items are ignored.

The values are interpreted as follows:

  • topStart: first value.
  • topEnd: second value, defaulting to same as topStart.
  • bottomStart: third value, defaulting to same as topStart.
  • bottomEnd: fourth value, defaulting to same as topEnd.

Implementation

static BorderRadiusGeometry? borderRadius(DataSource source, List<Object> key) {
  final Radius? a = radius(source, [...key, 0]);
  if (a == null) {
    return null;
  }
  final Radius? b = radius(source, [...key, 1]);
  final Radius? c = radius(source, [...key, 2]);
  final Radius? d = radius(source, [...key, 3]);
  return BorderRadiusDirectional.only(
    topStart: a,
    topEnd: b ?? a,
    bottomStart: c ?? a,
    bottomEnd: d ?? b ?? a,
  );
}