diagonal property

double get diagonal

Diagonal scaling - scales by width * height product.

Useful for values that should scale with screen area.

Implementation

double get diagonal {
  final context = AdaptiveContext.maybeContext;
  if (context == null) return toDouble();
  final data = AdaptiveData.maybeOf(context);
  if (data == null) return toDouble();
  final info = data.getDeviceInfo(context);
  return toDouble() * info.scaleWidth * info.scaleHeight;
}