We present a normative computational theory of how neural circuitry in the Dorsal Visual Stream (DVS) and the Posterior Parietal Cortex (PPC) support visually guided goal-directed actions in a dynamical environment through flexible goal-encoding intentions. It builds on Active Inference, in which perception and motor control signals are inferred through dynamic minimization of generalized prediction errors. The PPC is proposed to maintain a belief over bodily state and relevant objects on the scene, and by manipulating these states, it is involved along with visual, frontal, and motor areas in dynamically generating goal-directed actions including motor planning and movement control. Specifically, the PPC is viewed as a dynamic system computing flexible motor intentions and directing belief over the latent body state towards dynamic future goals, while the DVS is viewed as a generative model translating beliefs into visual sensory predictions in order to infer targets and posture. An intention-driven Active Inference agent that embodied an actuated upper limb with visual and proprioceptive sensors was able to perceive and reach visual targets, behaving correctly under various conditions, including static and dynamic targets, different sensory feedback, sensory precisions, intention gains, and movement policies. The theory is of general interest because it provides a normative basis for a variety of neurophysiological investigations of flexible goal-directed behavior and sensorimotor processes in end-to-end settings and further advances Artificial Intelligence methods for sensorimotor control.