Written by: Tornike Kurdadze | Thu Dec 12 2024 Category hierarchy

Introduction

When it comes to Flutter development, there are many ways to structure your code. You can choose to keep everything in one file, or you can separate your code into multiple files and folders. But how much abstraction do you really need? In this article, we’ll explore different levels of abstraction in Flutter and discuss the pros and cons of each approach.

Let’s start with the most minimal approach and work our way up to more complex abstractions.

1. No Abstraction

Well, it’s a good old StatefullWidget, which is great for simple widgets like buttons, text, checkboxes, etc. because they don’t require much logic or third party dependencies like API calls, database operations, etc.

I already have coffee, buy me an enduro bike instead 🏔️🚵‍♂️