Table of Contents

Introduction

GetX really caught my attention by being extraordinary. It is the most liked package on pub.dev (June 2023) but at the same time the most hated by big parts of the community. I asked myself how this could be and during my research, I discovered that there is more to consider than the code. Besides the objective (dis-)advantages that exist, there have been heated discussions, lies, and false claims with some of the biggest Flutter celebrities involved. So stay tuned if you are interested in more detail about GetX or the biggest Flutter gossip.

What is GetX

GetX is a Flutter package that combines different functionalities. In contrast to most packages that provide a solution for one specific topic, GetX includes multiple functionalities like state management, dependency injection, and routing in one package (more to this later on). It claims to have a high performance, to be focused on developer productivity, and to improve the organization by having clean code by default.

Advantages and Popularity

GetX makes some things easier for beginners which explains its huge popularity. Also, it claims to have a lot of advantages. Following, these points get discussed.

1 It is simple

The main advantage of GetX is that it looks very simple. Flutter is already quite simple but GetX makes your code even shorter (This has also disadvantages which get discussed later). Some examples (Other packages are not compared):

Routing GetX

Get.to(NextScreen());

Routing Flutter


Navigator.of(context).push(
    MaterialPageRoute(
      builder: (context) => NextScreen(),
    ),
  );

Snackbar GetX

Get.snackbar("Hi","Message");

Snackbar Flutter

const snackBar = SnackBar(
  content: Text('Yay! A SnackBar!'),
);

ScaffoldMessenger.of(context).showSnackBar(snackBar);

The GetX code is short. Shorter code is better if it does the same because you can understand and write the code faster. We discuss later why oversimplifications like leaving out build contexts can sound great in the beginning but can lead to major problems in your apps.

2 It is one for all

Another reason that makes GetX interesting (especially for beginners) is that it covers a lot of different topics:

  • State management
  • Navigation
  • Snackbars, dialogs, bottom sheets
  • Key value storage
  • Internationalization
  • Theme control
  • Validators
  • HTTP calls
  • Dependency injection

GetX does these things and even more. The advantage (for beginners) is that you do not have to make a choice for every functionality. You trust GetX and can do a lot with one package. This comes obviously with disadvantages which get discussed later.

3 It claims a lot

GetX claims to be high performing, great for productivity and to have clean code by default. We will discuss these points later in The Hate but these claims can be shiny and misleading and are a big part of GetX's success.

Disadvantages

1 No build context

First things first. GetX violates one of the Ten Flutter Commandments

You shall use a BuildContext!

Not using a BuildContext makes things easier. You do not have to pay attention to where you get your BuildContext from. You do not have to pay attention to async gaps. But this comes at a cost. Imagine showing a Snackbar (example from Reddit). It is possible to show it without a BuildContext but without it, other widgets do not know what has changed and how their position has to change accordingly. So if a SnackBar appears and you also have a FloatingActionButton, the FloatingActionButton does not know that it has to move up because it does not get the BuildContext information from the SnackBar. This is just one example but this can lead to other wrong behavior.

2 Bad documentation

In general, I personally do not like the documentation. It is too focused on telling that GetX is great and not explaining what and how it does things. Furthermore, the code is not that well documented. Of 2452 API elements which is a lot only 742 have documentation comments (30.2%). This still gets ten out of ten points on pub.dev but compared to other major packages like Riverpod (89.2%), this is not good.

3 It is not really Flutter

Because GetX does not use some of the major concepts of Flutter like BuildContext, you as a developer will have difficulties changing from GetX to other packages.

4 Depends (mainly) on one person

GetX mainly depends on its creator Johnny Borges. For one year there has not been an update of the release version (June 2023). If you are relying on a large package like GetX you are dependent on updates of it. Because there is only one author that supervises the project in his free time (which I highly appreciate), you can not really rely on bug fixes and necessary changes. Because of its wide usage, there is of course motivation to continue the project, nevertheless, it is hard to rely on bugfixes and other improvements. There are for example pull requests from 2020 that are still open and over 700 open issues (June 2023).

5 Some functionality does not work

As stated before there are currently over 700 issues open (June 2023). You can not expect that every functionality works perfectly in this package which is a huge disadvantage. Also, some issues are claimed to be fixed but people still get the bug (e.g. here and here). This is not what you want for your production code.

The Hate

There are some serious disadvantages to GetX, nevertheless, this is not the reason why the package is that hated. The main reason for this is in my opinion the inappropriate behavior of the author. There are some claims that I couldn't verify (leave a comment if you have prooves for this). E.g. that he used fake accounts to promote his package on Reddit and to invalidate people that created issues on GitHub. Also, the same Reddit comment states that he "literally threatened and tried to sue someone who forked his open source package LOL". My research gives me the feeling that this could be true.

Johnny Borges created a benchmark that compared GetX with the Bloc library (the benchmark does not exist anymore). Bloc creator Felix Angelov created an issue Benchmarks do not appear to be accurate #243. Johnny Borges reacted to this by stating that the benchmark was manipulated and that he finds it unfair that Felix calls his test a "farce test". Now Remi Rousselet (creator of Riverpod, Provider, and more) enters the conversation and shows that neither Felix manipulated the benchmark nor called the test a "farce test" (which, funnily enough, can be proven by his unedited post). So Johnny Borges posted a false benchmark and then lied when this got addressed in an issue. To no surprise, the community disrespects this behavior.

The Flutter team also removed GetX temporarily from the recommended state management options because of the false claims about the benchmarks. It got added again after deleting the benchmark and the claims in the README.

Conclusion

To summarize, GetX is a package that has lots of functionalities and (over-)simplifies Flutter concepts. This in combination with false claims of the superior performance of GetX leads to wide usage and also the most liked package on pub.dev. At the same time, it has a lot of ongoing issues which do not get resolved and shortcomings because of oversimplifications. It is necessary to emphasize that the community hate does not come from the code but from the person maintaining it who showed rude behavior in discussions and made false claims. In total, I would not recommend using it.

Do you have a different opinion about GetX? Do you have ideas for the nine other Flutter Commandments? Please let me know in the comments. Any further feedback is highly appreciated!

If you liked the article clap (50x), highlight, comment, and share it. Not only but especially technical articles got disadvantaged by the new Medium Partner Program incentives. If you want to support your favorite (technical) writers on Medium, remember to interact with the articles. You find more information about this here: The New Medium Partner Program is Bad for Quality Writing!

Further Resources

Most of my information comes from these sources.

More articles