sampleArea static method

Rect sampleArea(
  1. Rect bar
)

Where UIKit reads the backdrop: its mean luma over the bar's container (the screen's width, from the bar's top to the screen's bottom) grown by the glass's 12.4pt margin. For a bar laid out 21pt from the screen's sides and bottom, that is the bar grown by 21pt to the sides and below and 12.4pt above.

Implementation

static Rect sampleArea(Rect bar) => Rect.fromLTRB(
  bar.left - 21,
  bar.top - 12.4,
  bar.right + 21,
  bar.bottom + 21,
);