getCube function

SizedBox getCube(
  1. int percent,
  2. dynamic context
)

Returns a SizedBox with width and height based on the specified percentage of the screen dimensions.

Implementation

SizedBox getCube(int percent, context) {
  return SizedBox(
    width: (MediaQuery.of(context).size.width * (percent / 100)).toDouble(),
    height: (MediaQuery.of(context).size.height * (percent / 100)).toDouble(),
  );
}