Refactoring a Flutter Project — a Story About Progression and Decisions

Gonçalo Palma
Flutter Community
Published in
10 min readSep 30, 2019

--

Photo by Daniel McCullough on Unsplash

When doing any IT project, we sometimes don’t think on the weight of every decision we are making. Abstracting too much or too less, using X, Y or Z library, gluing up code that “will be fixed later”, and so many other countless examples. Each of these decisions has a cost. The peculiar thing is that that cost is going to bite us back not today, not tomorrow, but eventually, and when that “eventual” day comes, we may lose hours, days or weeks trying to retrace our steps or fixing our mess of a codebase.

This article is going to expose one of those stories. It’s not an article about how to create the “perfect architecture”, nor the best approaches for each problem, but it is an article about how I struggled with these issues and how I found a solution that, for the moment, works perfectly in my case.

Also, this also serves to show that it’s okay to make mistakes. When we are inexperienced, both in programming or in a specific framework or technology, we will make bad decisions eventually. That’s not what matters, what matters is how we handle them in the future.

So let’s begin our story.

The starting BLoCs of an App

When coming to Flutter and Dart, it might take a while to get into the flow of how…

--

--

Gonçalo Palma
Flutter Community

Author, Flutter Lead Developer @Pvotal Tech. Organizer, Google Developer Expert for Flutter and Dart, Lead Flutter Developer. 🌍 https://gpalma.pt/