getPointOnComponent method

Offset getPointOnComponent(
  1. Alignment alignment
)

Returns Offset position on this component from alignment.

Alignment.topLeft returns Offset.zero

Alignment.center or Alignment(0, 0) returns the center coordinates on this component.

Alignment.bottomRight returns offset that is equal to size of this component.

Implementation

Offset getPointOnComponent(Alignment alignment) {
  return Offset(
    size.width * ((alignment.x + 1) / 2),
    size.height * ((alignment.y + 1) / 2),
  );
}