sqBox method

SizedBox sqBox([
  1. Widget? child
])

Creates a fixed square sized SizedBox with the specified height and width equal to this num.

This method converts the num value to a double and uses it for both height and width.

child is an optional child widget to be placed inside the SizedBox.

Returns a SizedBox with equal height and width.

Example:

20.sqBox(Text('Square Box'))

Implementation

SizedBox sqBox([Widget? child]) =>
    SizedBox(height: toDouble(), width: toDouble(), child: child);