pad method

Padding pad({
  1. double left = 0,
  2. double right = 0,
  3. double top = 0,
  4. double bottom = 0,
  5. double? vertical,
  6. double? all,
  7. double? horizon,
})

配置尺寸适配 >>>

Implementation

Padding pad(
    {double left = 0,
    double right = 0,
    double top = 0,
    double bottom = 0,
    double? vertical,
    double? all,
    double? horizon}) {
  EdgeInsets insets;
  if (all != null) {
    insets = EdgeInsets.all(all);
  } else {
    double _left = horizon ?? left;
    double _right = horizon ?? right;
    double _top = vertical ?? top;
    double _bottom = vertical ?? bottom;
    insets = EdgeInsets.fromLTRB(_left, _top, _right, _bottom);
  }
  return Padding(
    padding: insets,
    child: this,
  );
}