getBorderRadius static method

BorderRadius? getBorderRadius(
  1. BorderInfo borderInfo
)

Implementation

static BorderRadius? getBorderRadius(BorderInfo borderInfo){
  if(borderInfo.edgeInfo!=null){
    double top=0;
    double left=0;
    double right=0;
    double bottom=0;
    EdgeInfo edgeInfo = borderInfo.edgeInfo!;
    if(edgeInfo.right!=null&&edgeInfo.right!>0){
      right = edgeInfo.right!;
    }
    if(edgeInfo.left!=null&&edgeInfo.left!>0){
      left = edgeInfo.left!;
    }
    if(edgeInfo.bottom!=null&&edgeInfo.bottom!>0){
      bottom = edgeInfo.bottom!;
    }
    if(edgeInfo.top!=null&&edgeInfo.top!>0){
      top = edgeInfo.top!;
    }
    if(top==0&&left==0&&right==0&&bottom==0){
      return BorderRadius.circular(edgeInfo.all);
    }else{
      return BorderRadius.only(topLeft: Radius.circular(left),topRight: Radius.circular(top),bottomRight: Radius.circular(right),bottomLeft: Radius.circular(bottom));
    }
  }
  return null;
}