p property

EdgeInsets get p

Implementation

EdgeInsets get p {
  final length = this.length;
  if (length == 0 || length == 3 || length > 4) {
    throw ArgumentError('Scalify Padding Error: List length must be 1, 2, or 4. Received: $length');
    }
  if (length == 1) {
    return EdgeInsets.all(this[0].s);
  } else if (length == 2) {
    return EdgeInsets.symmetric(horizontal: this[0].s, vertical: this[1].s);
  } else {
    // length == 4
    return EdgeInsets.fromLTRB(this[0].s, this[1].s, this[2].s, this[3].s);
  }
}