awaitLayout method
Wait for a widget's layout to stabilize using its GlobalKey.
Convenience wrapper around PostFrame.onLayout with context access.
Implementation
Future<Size?> awaitLayout(
GlobalKey key, {
int maxWaitFrames = 20,
int stabilityFrames = 2,
bool waitForEndOfFrame = true,
}) {
return PostFrame.onLayout(
key,
maxWaitFrames: maxWaitFrames,
stabilityFrames: stabilityFrames,
waitForEndOfFrame: waitForEndOfFrame,
);
}