Declare Flutter Final!

Greg Perry
Flutter Community
Published in
9 min readNov 27, 2020

--

Remember Flutter’s declarative language characteristics

HTML is a declarative programming language. It’s a markup language that represents in text script and in symbols a webpage at a specific point in time. The word used here is important. HTML ‘represents’ and does not ‘present’ the webpage. It’s a browser that does all the actual work — it reads the HTML, performs the rendering, and then presents a webpage with all its text, its lines, its buttons, its forms, etc. When it all comes down to it, HTML is just the instructions.

When You look at raw HTML source code, you are looking at a ‘static representation’ or a snapshot of what the webpage is to look like (as well as potentially what it is capable of doing) at that given moment. That text at that very instant is immutable. Unchanging. It’s only with a new HTML request, will a webpage ‘change’ its content. Note, in many cases, the change is not by modifying the existing HTML here and there, but by rebuilding the whole page all over again from scratch. Though not readily apparent, it’s an efficient approach. The HTML itself takes up little memory. It's just instructions after all.

You see, Flutter is a pseudo-declarative UI framework. It has its imperative, reactive, and functional programming characteristics, but it’s its declarative language characteristic that uses this ‘rebuild from scratch’ approach. With every call to a build() function, for example, from a State object or a Stateless widget, the returning widget is more often than not re-created all over again…

--

--