Size → aspect, with empty sizes treated as square.
static double aspectOf(Size size) => size.height > 0 && size.width > 0 ? size.width / size.height : 1;