I've been to Venice, and right now, there's no land for farming. Even back when some of the land was still exposed, it seems too small to sustain a city-sized population. So has Venice been trading with neighbors for food since the earliest days? They can't have had farmers on the mainland, because the whole point of going to the island was to avoid raiders on the mainland, right?
The period when people travelled to Venice to avoid conflict on the mainland was only a brief period in the city's history, and calling it a city at all at that point in time is a massive stretch. Norwich dates the consecration of San Giacomo di Rialto as an outpost of the Bishop of Padua at sometime in the fifth century, and at that point in time the "Rialto" was literally a "Rio Alto," a high sandbank of sediment from the Brenta river. To this day, many of the islands of the Venetian lagoon are not densely built up and offer an image of what Venice must have looked like for much of its history. Venice does not become politically significant until the eight century, meaning that during the migration period most people fleeing conflict on the mainland only stayed for brief period of time; what refugees brought with them in addition to that which the islands could supply was evidently more than sufficient.
In fact, during the migration period and through the lifetime of the two and a half troubled polities calling themselves the "Kingdom of Italy," the community calling itself "Venice" was actually a union of multiple islands. So much so that in the early history of Venice high society was split between the pro-Byzantine landowners in Eraclea and the pro-Republican merchants of Malamocco. Certainly, many people migrated to the Venetian lagoon for its prosperity and security, but the early governments of Venice insisted on following a line in keeping with its status as a Byzantine commonwealth; a clear indication that food grown in the lagoon allowed Venice to ignore going-ons on the mainland. Also, during the visit to Venice did you ever stumble on the fish market on the Rialto? You seem to be forgetting the fact that Venice is on the sea, and Venetian cuisine continues to be centered on seafood today.
The area now known as the "City of Venice" became the seat of the government of the lagoon because its central pisition relative to the other communities. However, as late as the tenth century is was still only sparsely built up. St. Mark's square was only paved in 1264, and much of the city would remain unpaved until the early modern era. In traditional Venetian urban planning homes were built with their front door right up on the water, with orchards and gardens out back. As the city became more populated, houses lining the waterfront came to enclose individual islands; but in Venetian parlance, these spaces continue to this day to be called "Campi," literally meaning "Fields." It is only in the fourteenth century that Venetian urban construction is sufficiently dense that the individual islands of Venice can be termed a single city.
The maps present here (specifically, page 13) can give you an idea of the "natural" layout of the Rialtine Islands. By the time the city of Venice reached its highest density and could no longer feed its population with the food grown on the lagoon, it had already become the suzerain of a thalassocracy, making food security a non-issue.
By the early 15th century, the territory ruled by the Venetian Doge and Senate would come to encompass the whole of northeastern Italy, in addition to overseas colonies), and was recognized as the post powerful polity in Italy. Even after losing its colonial empire, the Republic would keep its possessions on the Italian mainland, guaranteeing food security.
The gold standard on Venetian history was written by John Julius Norwich, his "A History of Venice" is a must-read for those interested in learning about the city and republic of Venice.