AdaptiveNumExtension extension

Extension on num for adaptive sizing.

These extensions allow you to write responsive dimensions like:

Container(
  width: 200.aw,   // adaptive width
  height: 100.ah,  // adaptive height
  padding: EdgeInsets.all(16.ar), // adaptive radius
  child: Text('Hello', style: TextStyle(fontSize: 16.asp)),
)
on

Properties

ah double

Available on num, provided by the AdaptiveNumExtension extension

Adaptive height - scales based on the design height.
no setter
ar double

Available on num, provided by the AdaptiveNumExtension extension

Adaptive radius - scales uniformly using the smaller ratio.
no setter
asp double

Available on num, provided by the AdaptiveNumExtension extension

Adaptive font size - scales for typography.
no setter
aw double

Available on num, provided by the AdaptiveNumExtension extension

Adaptive width - scales based on the design width.
no setter
diagonal double

Available on num, provided by the AdaptiveNumExtension extension

Diagonal scaling - scales by width * height product.
no setter
diameter double

Available on num, provided by the AdaptiveNumExtension extension

Diameter scaling - scales by max(width, height) ratio.
no setter
gapH SizedBox

Available on num, provided by the AdaptiveNumExtension extension

Creates a vertical SizedBox with adaptive height.
no setter
gapW SizedBox

Available on num, provided by the AdaptiveNumExtension extension

Creates a horizontal SizedBox with adaptive width.
no setter
ph double

Available on num, provided by the AdaptiveNumExtension extension

Percentage of screen height.
no setter
pw double

Available on num, provided by the AdaptiveNumExtension extension

Percentage of screen width.
no setter