asyncPrepares method

void asyncPrepares(
  1. bool isOnce,
  2. ValueChanged<Rect>? onCallBack
)

Widget渲染监听.

Implementation

void asyncPrepares(bool isOnce, ValueChanged<Rect>? onCallBack) {
  if (_hasMeasured) return;
  WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
    if (isOnce) _hasMeasured = true;
    if (onCallBack != null) onCallBack(Rect.zero);
  });
}