toEdgeInsets method

EdgeInsets toEdgeInsets({
  1. required Size constraintSize,
  2. required Size screenSize,
})

Implementation

EdgeInsets toEdgeInsets(
    {required Size constraintSize, required Size screenSize}) {
  double top = this.top?.toPX(
          constraintSize: constraintSize.height, screenSize: screenSize) ??
      0.0;
  double bottom = this.bottom?.toPX(
          constraintSize: constraintSize.height, screenSize: screenSize) ??
      0.0;
  double left = this.left?.toPX(
          constraintSize: constraintSize.width, screenSize: screenSize) ??
      0.0;
  double right = this.right?.toPX(
          constraintSize: constraintSize.width, screenSize: screenSize) ??
      0.0;
  return EdgeInsets.only(
    left: left,
    right: right,
    top: top,
    bottom: bottom,
  );
}