createFractionallyAlignedSizedBox method

FractionallyAlignedSizedBox createFractionallyAlignedSizedBox({
  1. required Widget child,
  2. double? extentFactor,
  3. double? positionFactor,
})

Creates a FractionallyAlignedSizedBox related to the current direction and showed actions.

Implementation

FractionallyAlignedSizedBox createFractionallyAlignedSizedBox({
  required Widget child,
  double? extentFactor,
  double? positionFactor,
}) {
  return FractionallyAlignedSizedBox(
    leftFactor:
        directionIsXAxis ? (showActions ? positionFactor : null) : 0.0,
    rightFactor:
        directionIsXAxis ? (showActions ? null : positionFactor) : 0.0,
    topFactor: directionIsXAxis ? 0.0 : (showActions ? positionFactor : null),
    bottomFactor:
        directionIsXAxis ? 0.0 : (showActions ? null : positionFactor),
    widthFactor: directionIsXAxis ? extentFactor : null,
    heightFactor: directionIsXAxis ? null : extentFactor,
    child: child,
  );
}