height method

double height(
  1. double percentage
)

Returns a dynamic height depending on a percentage from 0-100% height.

Implementation

double height(double percentage) {
  if (percentage <= 0.0 || percentage > 100.1) {
    throw 'percentage from 1-100%';
  }
  return MediaQuery.of(this).size.height * (percentage / 100);
}