Member-only story

A Beginning Flutter App Pattern, Widget View

Fred Grott
3 min readJul 10, 2022

--

This is part of my work towards a beginning flutter app design book. When you start learning about the flutter SDK framework, it’s helpful to separate business logic from the declarative layout part. The Widget View pattern is ideal to separate out the business logic from the declarative layout part, and works well with both stateless and stateful widgets. Let me show you how to implement.

The Bad And The Ugly

First, let me show the standard flutter skeleton app template. The Homepage Sample List view:

Notice that we have the business logic of assigning Sample Items to a list and the route name mixed in with the declarative layout part. And let’s see the settings view:

Same set of problems, business logic mixed in with the declarative layout stuff.

--

--

Fred Grott
Fred Grott

No responses yet