The problem of flight is not so much one of staying aloft — it is getting up there to begin with. The crucial parameter is something called ‘wing loading,’ which describes the mass of the creature as a function of its wing area.
A large creature can take off, provided it has a big enough area of wing to support its weight and that it can reach a certain minimum take-off speed. This take-off speed depends on the wing loading.
The smallest pterosaurs, distant reptilian relatives of both birds and dinosaurs, were no bigger than sparrows. The largest, however, had wingspans on the order of 32-36 feet — as much as a small plane. However, the skeletons of pterosaurs were constructed with extraordinary lightness.
Birds are light for their size because many of their bones are hollow, and some are fused into rigid, airframe-like structures. Pterosaurs took this tendency to the extreme, and the result was enormous wings and very low wing loading.