wWithContext method
Ancho Responsive (DEPRECATED): Usa .w en su lugar (sin context).
Esta versión con context será eliminada en futuras versiones.
Migra tu código a usar .w directamente sin pasar context.
Implementation
@Deprecated('Usa .w en su lugar (sin context). Será eliminado en v3.0.0')
double wWithContext(BuildContext context, {
num? web,
num? ios,
num? android,
num? mobile,
num? tablet,
num? desktop,
}) {
final screenInfo = _getInfo(context);
// Si no se especifican parámetros multi-plataforma, usar comportamiento básico
if (web == null && ios == null && android == null &&
mobile == null && tablet == null && desktop == null) {
final normalizedValue = _normalizeValue(this);
return screenInfo.width * normalizedValue;
}
// Usar lógica multi-plataforma con 'this' como fallback
final values = <DeviceType, num>{};
if (web != null) values[DeviceType.web] = web;
if (ios != null) values[DeviceType.ios] = ios;
if (android != null) values[DeviceType.android] = android;
if (mobile != null) values[DeviceType.mobile] = mobile;
if (tablet != null) values[DeviceType.tablet] = tablet;
if (desktop != null) values[DeviceType.desktop] = desktop;
final normalizedValue = _getValueForDevice(screenInfo, values, this);
return screenInfo.width * normalizedValue;
}