usePostFrameEffect function

void usePostFrameEffect(
  1. VoidCallback effect, [
  2. List<Object?>? keys
])

Registers effect to be run in WidgetsBinding.instance.addPostFrameCallback.

Implementation

void usePostFrameEffect(VoidCallback effect, [List<Object?>? keys]) {
  useEffect(
    () {
      WidgetsBinding.instance.addPostFrameCallback((_) => effect());
      return null;
    },
    keys,
  );
}