PersonView

person

person

To create a scrolling view, Flutter uses SingleChildScrollView.
In the following example, the function mockPerson mocks instances
of the Person class to create the custom PersonView widget.

Test in DartPad

View on GitHub

Responsive and adaptive design

In SwiftUI, you use GeometryReader to create relative view sizes.

For example, you could:

Multiply geometry.size.width by some factor to set the width.

Use GeometryReader as a breakpoint to change the design of your app.

You can also see if the size class has .regular or .compact
using horizontalSizeClass.

To create relative views in Flutter, you can use one of two options:

Get the BoxConstraints object in the LayoutBuilder class.