DSIDrawerheightWidth function

dynamic DSIDrawerheightWidth(
  1. dynamic context,
  2. dynamic percentage,
  3. dynamic isHeight
)

Implementation

DSIDrawerheightWidth(context, percentage, isHeight) {
  double raw;
  if (isHeight) {
    raw = MediaQuery.of(context).size.height;
    double res = percentage * raw / 100;
    return res - 80;
  } else {
    raw = MediaQuery.of(context).size.width - 140;
    double res = percentage * raw / 100;
    return res;
  }
  return 0;
}