Responsive class

A utility class that helps make the UI responsive by defining the size of icons, buttons, and text relative to the screen size.

Constructors

Responsive({double fontSizeRelativeToScreen = 2.5, double maxFontSize = 16, double iconsSizeRelativeToScreen = 7, double maxIconsSize = 60, double buttonsSizeRelativeToScreen = 8, double maxButtonsSize = 60})
Creates a new Responsive instance.

Properties

buttonsSizeRelativeToScreen double
The relative size of buttons, expressed as a percentage of the screen size.
getter/setter pair
fontSizeRelativeToScreen double
The relative font size, expressed as a percentage of the screen size.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
height double
The height of the screen.
getter/setter pair
iconsSizeRelativeToScreen double
The relative size of icons, expressed as a percentage of the screen size.
getter/setter pair
inch double
The diagonal size of the screen in inches.
getter/setter pair
maxButtonsSize double
The maximum size of buttons.
getter/setter pair
maxFontSize double
The maximum font size.
getter/setter pair
maxIconsSize double
The maximum size of icons.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
The width of the screen.
getter/setter pair

Methods

buttonSize() double
Calculates the actual size of a button, taking into account the relative size and the maximum size.
fontSize() double
Calculates the actual font size, taking into account the relative size and the maximum size.
hp(double percent) double
Converts a percentage of the screen height into logical pixels.
iconSize() double
Calculates the actual size of an icon, taking into account the relative size and the maximum size.
ip(double percent) double
Converts a percentage of the screen size into inches.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDimensions(double widthProvided, double heightProvided) → void
Sets the screen dimensions.
toString() String
A string representation of this object.
inherited
wp(double percent) double
Converts a percentage of the screen width into logical pixels.

Operators

operator ==(Object other) bool
The equality operator.
inherited