scaleToHeight method

Widget scaleToHeight({
  1. required BuildContext context,
  2. double factor = 1.0,
})

Scales the widget proportionally to the screen's height.

Implementation

Widget scaleToHeight({
  required BuildContext context,
  double factor = 1.0,
}) {
  final screenHeight = MediaQuery.of(context).size.height;
  return Transform.scale(
    scale: screenHeight / 100 * factor,
    child: this,
  );
}