FleetPositioned.directional constructor

FleetPositioned.directional({
  1. Key? key,
  2. required TextDirection textDirection,
  3. double? start,
  4. double? top,
  5. double? end,
  6. double? bottom,
  7. double? width,
  8. double? height,
  9. required Widget child,
})

Corresponding constructor to Positioned.directional.

Implementation

factory FleetPositioned.directional({
  Key? key,
  required TextDirection textDirection,
  double? start,
  double? top,
  double? end,
  double? bottom,
  double? width,
  double? height,
  required Widget child,
}) {
  double? left;
  double? right;
  switch (textDirection) {
    case TextDirection.rtl:
      left = end;
      right = start;
      break;
    case TextDirection.ltr:
      left = start;
      right = end;
      break;
  }
  return FleetPositioned(
    key: key,
    left: left,
    top: top,
    right: right,
    bottom: bottom,
    width: width,
    height: height,
    child: child,
  );
}