ScreenInfo class
Clase inmutable que almacena las dimensiones de la pantalla y tipo de dispositivo. La inmutabilidad es clave para la eficiencia del InheritedWidget y el null safety.
- Annotations
Constructors
- ScreenInfo({required double width, required double height, required double textScale, required DeviceType deviceType})
-
const
Properties
- deviceType → DeviceType
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- height → double
-
final
- isAndroid → bool
-
Verifica si es Android (móvil o tablet)
no setter
- isDesktop → bool
-
Verifica si el dispositivo es desktop
no setter
- isIOS → bool
-
Verifica si es iOS (móvil o tablet)
no setter
- isLandscape → bool
-
Verifica si está en modo landscape
no setter
- isMobile → bool
-
Verifica si el dispositivo es móvil (iOS o Android, no tablet)
no setter
- isMobileAndroid → bool
-
Verifica si es específicamente Android móvil
no setter
- isMobileIOS → bool
-
Verifica si es específicamente iOS móvil
no setter
- isPortrait → bool
-
Verifica si está en modo portrait
no setter
- isTablet → bool
-
Verifica si el dispositivo es tablet
no setter
- isTabletOrDesktop → bool
-
Verifica si es tablet o desktop (pantallas grandes)
no setter
- isWeb → bool
-
Verifica si el dispositivo es web
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textScale → double
-
final
- width → double
-
final
Methods
-
heightBetween(
double min, double max) → bool - Verifica si el alto está entre dos valores
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
T> ({required T mobile(), required T tablet(), required T desktop(), T ios()?, T android()?, T web()?}) → T - Obtiene un valor según el tipo de dispositivo actual
-
widthBetween(
double min, double max) → bool - Verifica si el ancho está entre dos valores
Operators
-
operator ==(
Object other) → bool -
Sobreescritura crucial: Permite al InheritedWidget saber si ALGO cambió.
La igualdad requiere que TODAS las propiedades sean idénticas.
Si un campo es diferente, devuelve false, lo que dispara la notificación (info != oldInfo -> true).
override