Years ago in another life, Mike and myself built an Empire. Ok that may be a bit dramatic, but we did build Flutter Empire, an open source state management solution for Flutter applications. If you are familiar with Empire and just want to know what the future holds you can skip the history lesson. For those new to Empire, here’s how we got here…
Getting Blocked
Back in mid-2022, we were working on a Flutter application in the finance industry. The initial choice for state management for this project was Bloc. I was very familiar with Bloc and had used it on several projects before. This project was in that awkward phase of being large enough to require a state management solution beyond setState, yet not large enough to require all the features, and boilerplate, that comes with Bloc.
Don’t get me wrong, Bloc is amazing. It has a great community, excellent documentation, and is battle-tested in production applications. But we wanted something lighter. Something that would handle state without having to really think about it. Something that would make it easy to onboard new developers to the project.
So obviously the right choice as a developer was to completely reinvent the wheel..that is what you’re supposed to do right? Right?
An Empire Emerges
Mike and I came from a long history of working with C# and WPF applications. In that world, the MVVM (Model-View-ViewModel) pattern was king. We loved the separation of concerns it provided, and the way it made it easy to test and maintain applications. So we thought, why can’t we bring some of those concepts to Flutter?
Ultimately what we wanted was a way to bind our UI to our state, and have changes in state automatically update the UI. It was important that changing state was as simple as changing the value of a variable. No hooking into streams, no class bloat, just data. We also didn’t want to have to rely on any code generation, or 3rd party packages; we wanted something that was pure Dart and Flutter. Thus, we began laying the first blocks of what would become Empire.
A New Kind Of Wheel
As we built Empire, we dogfooded it on the finance app we were working on. Not only did it just work (and not just on my machine…), our overal velocity measurably increased. New developers were able to get up to speed quickly (Hi James 👋), and most importantly we were able to deliver features on time.
When version 1.0.0 launched in November of 2022, we caught the attention of a prominent member of the Flutter community Allen Wyma and invited us as guests on the Flying High with Flutter podcast. You can listen to that episode here. We knew we had something special, so we published Empire to pub.dev as an open source package, and the rest is history.
The Emergence of Unspeakable Evil
In early 2024, Mike and I left our cushy developer jobs and opted to enter the terrifyingly awesome world of entrepreneurship and Third Version Technology was born. As we started taking on clients, we found ourselves using Empire on nearly every Flutter project we worked on. It’s become our go-to state management solution for Flutter applications, and has been battle-tested in production applications across a variety of industries.
Then the impossible happened. Something so unexpected that it shook the very foundation of the earth. We found a bug.
Now to be fair, it was a minor bug, and affected virtually no one, but what I saw could not be unseen. The problem was that since we left our previous jobs, we no longer had access to the original repository where Empire was hosted, and nobody else on that team was maintaining it.
Eventually we forked it, fixed it and referenced our fork in our projects, but this is not the way a healthy open source project should be run. We needed to take control of our own destiny. We knew what was once the strong, unwavering Empire was now vulnerable to the forces of chaos and decay. The currents of time were all that could save it.
A New Hope
Today we are excited to announce the successor to the Empire: Flutter Current. On day one (so today) Flutter Current will be a direct port of Empire with all the same features and APIs. Although there is one major change, everything has been renamed from Empire to Current, naturally. For example:
Empire Examples
import 'package:empire/empire.dart';
final age = EmpireIntProperty(40);
// Also approximately how many grey hairs I have now in my beard
import 'package:empire/empire.dart';
class OrderPage extends EmpireWidget<OrderPageViewModel> {
// your code here
}
Current Examples
import 'package:current/current.dart';
final age = CurrentIntProperty(40);
import 'package:current/current.dart';
class OrderPage extends CurrentWidget<OrderPageViewModel> {
// your code here
}
If you are an existing Empire user, we encourage you to migrate to Flutter Current as soon as possible. It is quite literally a find-and-replace job. But this is just the beginning. We will continue to build on the solid foundation that Empire provided, and are committed to supporting Flutter Current for the long haul. If you are new to Empire/Current, we invite you to give it a try and see how it can help you build better Flutter applications. Suggestions and contributions are always welcome. Together, we can ensure that the Empire remains Current for years to come.
Great Justin. How can I help?
I’m glad you asked! If you have any questions about Flutter Current, or would like to provide feedback, please don’t hesitate to reach out to us on GitHub. We are always looking for ways to improve the package and make it better for the community. If you would like to contribute to the project, please check out our code of conduct before submitting a pull request. No contribution is too small, and we welcome all contributions from the community. Thank you for your support, and we look forward to hearing from you!