Positioned.fromRect constructor

Positioned.fromRect({
  1. Key? key,
  2. required Rect rect,
  3. required Widget child,
})

Creates a Positioned object with the values from the given Rect.

This sets the left, top, width, and height properties from the given Rect. The right and bottom properties are set to null.

Implementation

Positioned.fromRect({super.key, required Rect rect, required this.child})
    : left = rect.left,
      top = rect.top,
      width = rect.width,
      height = rect.height,
      right = null,
      bottom = null;