View on GitHub

Aligning components vertically

The following examples build on those in the previous section.

In SwiftUI, you use VStack to arrange the components into a
vertical pillar.

VStack

Image

systemName

"globe"

Text

"Hello, world!"

Flutter uses the same Dart code from the previous example,
except it swaps Column for Row:

Test in DartPad

View on GitHub

Displaying a list view

In SwiftUI, you use the List base component to display sequences
of items.
To display a sequence of model objects, make sure that the user can
identify your model objects.
To make an object identifiable, use the Identifiable protocol.

struct

Person

Identifiable

var

name