usePostFrameEffect function
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,
);
}