placeTo method

  1. @override
(Rect, Rect) placeTo(
  1. Rect area
)
override

place the axis to the given area and return the areas of the axis (areaAxis) and the area left (areaLeft).

Implementation

@override
(Rect areaAxis, Rect areaLeft) placeTo(Rect area) {
  if (position == GAxisPosition.start) {
    return (
      Rect.fromLTWH(area.left, area.top, size, area.height),
      Rect.fromLTWH(
        area.left + size,
        area.top,
        area.width - size,
        area.height,
      ),
    );
  } else if (position == GAxisPosition.end) {
    return (
      Rect.fromLTWH(area.right - size, area.top, size, area.height),
      Rect.fromLTWH(area.left, area.top, area.width - size, area.height),
    );
  } else if (position == GAxisPosition.startInside) {
    return (
      Rect.fromLTWH(area.left, area.top, size, area.height),
      area.inflate(0),
    );
  } else if (position == GAxisPosition.endInside) {
    return (
      Rect.fromLTWH(area.right - size, area.top, size, area.height),
      area.inflate(0),
    );
  } else {
    return (Rect.zero, area.inflate(0));
  }
}