positioned method

Positioned positioned({
  1. double? left,
  2. double? right,
  3. double? top,
  4. double? bottom,
  5. double? width,
  6. double? height,
  7. double? all,
  8. double? horizon,
  9. double? vertical,
})

指定控件的位置, 适用于Stack >>>

Implementation

Positioned positioned(
    {double? left,
    double? right,
    double? top,
    double? bottom,
    double? width,
    double? height,
    double? all,
    double? horizon,
    double? vertical}) {
  if (all != null) {
    return Positioned(
      child: this,
      left: all,
      right: all,
      top: all,
      bottom: all,
    );
  }
  double? _left = horizon ?? left;
  double? _right = horizon ?? right;
  double? _top = horizon ?? top;
  double? _bottom = horizon ?? bottom;
  return Positioned(
    child: this,
    left: _left,
    right: _right,
    top: _top,
    bottom: _bottom,
    width: width,
    height: height,
  );
}