Flocking, coordinated movement of individuals, widely observed in animal societies, and it is commonly used to guide robot swarms in cluttered environments. In standard flocking models, robot swarms often use local interactions between the robots and obstacles to achieve safe collective motion using virtual forces. However, these models generally involve parameters that must be tuned specifically to the environmental layout to avoid collisions. In this paper, we propose a predictive flocking model that can perform safe collective motion in different environmental layouts without any need for parameter tuning. In the model, each robot constructs a search tree consisting of its predicted future states and utilizes a heuristic search to find the most promising future state to use as the next control input. Flocking performance of the model is compared against the standard flocking model in simulation in different environmental layouts, and it is validated indoors with a swarm of six quadcopters. The results show that more synchronized and robust flocking behavior can be achieved when robots use the predicted states rather than the current states of others.