Phase retrieval (PR) is an important component in modern computational imaging systems. Recent advances in deep learning have introduced new possibilities for a robust and fast PR. An emerging technique called deep unfolding provides a systematic connection between conventional model-based iterative algorithms and modern data-based deep learning. Unfolded algorithms, which are powered by data learning, have shown remarkable performance and convergence speed improvement over original algorithms. Despite their potential, most existing unfolded algorithms are strictly confined to a fixed number of iterations when layer-dependent parameters are used. In this study, we develop a novel framework for deep unfolding to overcome existing limitations. Our development is based on an unfolded generalized expectation consistent signal recovery (GEC-SR) algorithm, wherein damping factors are left for data-driven learning. In particular, we introduce a hypernetwork to generate the damping factors for GEC-SR. Instead of learning a set of optimal damping factors directly, the hypernetwork learns how to generate the optimal damping factors according to the clinical settings, thereby ensuring its adaptivity to different scenarios. To enable the hypernetwork to adapt to varying layer numbers, we use a recurrent architecture to develop a dynamic hypernetwork that generates a damping factor that can vary online across layers. We also exploit a self-attention mechanism to enhance the robustness of the hypernetwork. Extensive experiments show that the proposed algorithm outperforms existing ones in terms of convergence speed and accuracy and still works well under very harsh settings, even under which many classical PR algorithms are unstable.