onLayoutRendered static method

void onLayoutRendered(
  1. VoidCallback callback
)

DO THAT:

WidgetsBinding.instance.addPostFrameCallback((_) => callback());

Implementation

static void onLayoutRendered(VoidCallback callback) {
  WidgetsBinding.instance.addPostFrameCallback((_) => callback());
}