width method
Calculates the dynamic width based on the provided value and the screen dimensions.
The width
method calculates the dynamic width based on the provided value and the screen dimensions.
value
: The value representing a percentage of the initial width value.- Returns: The calculated dynamic width value.
Implementation
double width(double value) {
return MediaQueryData.fromView(WidgetsBinding.instance.window).size.width *
((value * 100 / _width) / 100);
}