borderRadiusScaled method

BorderRadius borderRadiusScaled({
  1. double? all,
  2. double? left,
  3. double? right,
  4. double? top,
  5. double? bottom,
  6. double? leftTop,
  7. double? leftBottom,
  8. double? rightTop,
  9. double? rightBottom,
  10. Radius createRadius(
    1. double
    )?,
})
inherited

Implementation

BorderRadius borderRadiusScaled({
  double? all,
  double? left,
  double? right,
  double? top,
  double? bottom,
  double? leftTop,
  double? leftBottom,
  double? rightTop,
  double? rightBottom,
  Radius Function(double)? createRadius,
}) {
  // by default, the radius is half the margin.
  final base = size2;
  var lt = base;
  var lb = lt;
  var rt = lt;
  var rb = lt;
  if(all != null) {
    lt = base * all;
    lb = base * all;
    rt = base * all;
    rb = base * all;
  }
  if(left != null) {
    lt = base * left;
    lb = base * left;
  }
  if(right != null) {
    rt = base * right;
    rb = base * right;
  }
  if(top != null) {
    lt = base * top;
    rt = base * top;
  }
  if(bottom != null) {
    lb = base * bottom;
    rb = base * bottom;
  }
  if(leftTop !=  null) {
    lt = base * leftTop;
  }
  if(leftBottom != null) {
    lb = base * leftBottom;
  }
  if(rightTop != null) {
    rt = base * rightTop;
  }
  if(rightBottom != null) {
    rb = base * rightBottom;
  }
  createRadius ??= radiusCircular;

  return BorderRadius.only(
    topLeft: createRadius(lt),
    bottomLeft: createRadius(lb),
    topRight: createRadius(rt),
    bottomRight: createRadius(rb)
  );
}