postFrame method

void postFrame(
  1. VoidCallback callback
)

Used to update widget in next frame

Implementation

void postFrame(VoidCallback callback) {
  Future.delayed(Duration.zero, () {
    if (mounted) callback();
  });
}