Is it a good idea to use two state management in one flutter project

Viewed 713

I am a bit confused by one of the repositories, I found on Github with 47 stars. He has used 2 state management dependencies that are GetX and Flutter_bloc. These both are good.

https://github.com/omergamliel3/flutter-clean-architecture-app

bloc state managment

flutter_bloc: ^6.0.6

GetX mico-framework

get: ^3.24.0

In my project, I want to cover testing as well as it should be simple to implement state management.

I go through multiple articles and discussions and found that GetX is quite simple to understand if compare with Bloc, but didn't have a testing document (My week point is testing) but at the same time Bloc is having all this test-related documentation which is well organized but lots of boilerplate.

Now, what if, I used both? Can I use some features of GetX and some of BloC? then what will be the future scope of my project in terms of maintainability?

1 Answers

I don’t think there is anything wrong if you use multiple state management in one project but if you’re talking about maintainability then I think you should only go with only one state management.

Although, if you want to use both state management then make sure about maintaining the file structure between both state management, so in the future, any developer can read and understand the code.

Or if you want to use only one state management then I agree GetX is quite simple but do not underestimate the BLoC pattern. BLoC is considered one of the best state management for flutter.

Related