D.1. What’s the equivalent of UIView in Flutter?
In iOS, you create your UI with view objects that are instances of UIView. In Flutter, everything is a widget, and that’s the closest comparison to a UIView. They aren’t exactly the same because they handle more, but they are used to construct UIs. For our intent and purpose, they’re close enough. So, if widgets are UIViews, what are the differences?
First, widgets are immutable. They’re light-weight blueprints for the UI that are destroyed as soon as they need to be changed. Every time the configuration or state of a widget changes, Flutter redraws the relevant widget tree. But widgets are just descriptions for actual elements and don’t get drawn to the screen directly.
Also, because of the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access