getInnerBoxMargin method

EdgeInsets? getInnerBoxMargin()

Implementation

EdgeInsets? getInnerBoxMargin() {
  var computedBorderTopWidth = 0.0;
  var computedBorderRightWidth = 0.0;
  var computedBorderBottomWidth = 0.0;
  var computedBorderLeftWidth = 0.0;
  var originBorderWidth = borderWidth;
  if (originBorderWidth != null && originBorderWidth > 0) {
    computedBorderTopWidth = originBorderWidth;
    computedBorderRightWidth = originBorderWidth;
    computedBorderBottomWidth = originBorderWidth;
    computedBorderLeftWidth = originBorderWidth;
  }
  var originBorderTopWidth = borderTopWidth;
  var originBorderRightWidth = borderRightWidth;
  var originBorderBottomWidth = borderBottomWidth;
  var originBorderLeftWidth = borderLeftWidth;
  if (originBorderTopWidth != null && originBorderTopWidth > 0) {
    computedBorderTopWidth = originBorderTopWidth;
  }
  if (originBorderRightWidth != null && originBorderRightWidth > 0) {
    computedBorderRightWidth = originBorderRightWidth;
  }
  if (originBorderBottomWidth != null && originBorderBottomWidth > 0) {
    computedBorderBottomWidth = originBorderBottomWidth;
  }
  if (originBorderLeftWidth != null && originBorderLeftWidth > 0) {
    computedBorderLeftWidth = originBorderLeftWidth;
  }
  if (computedBorderTopWidth > 0 ||
      computedBorderRightWidth > 0 ||
      computedBorderBottomWidth > 0 ||
      computedBorderLeftWidth > 0) {
    return EdgeInsets.only(
      top: computedBorderTopWidth,
      right: computedBorderRightWidth,
      bottom: computedBorderBottomWidth,
      left: computedBorderLeftWidth,
    );
  }
  return null;
}