In late 2019, Betterment committed to becoming a mobile-first company. Our customers were happy with our Android and iOS apps, but as an engineering team, we knew that our native codebases were not the best they could be. We had years of legacy code to maintain and were seeing a slowdown in our ability to get new features out to our customers. We were at a critical juncture that many engineering teams face.
We could have done what a lot of companies tend to do and simply hire more developers to help overhaul the codebase. Instead, we made the bold decision to completely replatform our application using Flutter, Google’s toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Switching to Flutter helped us achieve the monumental shift to become a mobile-first company and has vastly improved the productivity and happiness of our engineering team.
Committing to cross-platform
It no longer made sense to have two separate teams work on the same app for different devices. We needed a cross-platform solution so that our entire engineering team could work from one codebase and deploy to both iOS and Android. We began by researching the usual cross-platform solutions: React Native, Kotlin Multiplatform, and Flutter.
We were initially drawn to Flutter because we had heard that it could speed up the development process. Developers reported being able to build features faster and Flutter would allow us to control everything from UI to the business logic with one codebase. We even talked to one company that confirmed they saw a huge boost in productivity after choosing Flutter over React Native. Flutter was looking more and more appealing.
We then conducted an objective assessment to measure Flutter against native iOS and Android respectively before making the commitment to switch over. We designed a list of specific criteria to compare, including customer experience, CI/CD integration, app architecture, UI design, available community resources, testing and test automation, accessibility, developer happiness, and migration/integration — all of the things we care about as an engineering team. We asked ourselves questions such as: Does Flutter allow us to avoid writing platform-specific code in the majority of cases?
It turns out that Flutter scored “as good as” or “better” than native iOS and Android for the majority of criteria we outlined. With this, we were confident in our decision to move ahead with Flutter.
We knew right away that we did not want to discard years of work and risk disrupting users by rebuilding our app from scratch with Flutter. We also did not want to waste any time. We needed to get this transition to Flutter right, so we sought out the help of an outside Flutter development consultancy Very Good Ventures. They had built some of the very first Flutter apps and could give us the expertise we needed to get up to speed on Flutter quickly.
We came up with a plan to designate a small internal team to pilot Flutter while the rest of the team continued to work on the native apps. If we could get Flutter code to integrate with our existing native codebase, we could gradually migrate features over until our entire codebase was rewritten in Flutter.
Together our pilot team worked with a couple of Very Good Ventures engineers to build a checking flow allowing users to create a checking account directly in our app. With the add-to-app option, we integrated the Flutter feature into our existing native codebases. It worked! Our app had Flutter code coexisting with native code and users still got the same high-performing functionality.
Getting our entire team on board
Then came time for the arguably larger transition: convincing the entire Betterment mobile team, composed of developers who had been working with native iOS and Android for years, that a switch to Flutter was worth it. Adopting Flutter would not only be a huge shift for our codebase, but also for our culture, since the decision could have a huge impact on our teammates’ careers. Would this mean developer titles would change? How would this affect each developer’s future at the company?
We wanted to ensure that all employees had an avenue to voice their concerns, so we kept them updated at every stage of our investigation into Flutter. We also developed an FAQ sheet tailored to specific questions they asked about Flutter as well as a newsletter regularly reporting on the internal pilot team’s progress.
The most important thing was emphasizing that Betterment was committed to supporting each member on our team during our switch to Flutter. We would not ask our team to go through a coding bootcamp or individual training on their own. Everyone on the mobile team would receive the same training during work hours.
Flutter training was the final major inflection point in our progress as a team. Very Good Ventures facilitated a formal Flutter training program over the course of a week with a series of presentations and breakout sessions. The training helped each engineer on our team establish the same baseline understanding of the basics and best practices we would need to know to build a scalable app with Flutter.
After the first day of training, some developers were on the fence, but willing to give it a shot. By the second week of training, everyone was excited to be building with the new framework. Each member on our team was contributing meaningful updates to our codebase in less than two weeks. On top of that, many of our teammates said that the training was simply fun.
An interesting side effect of the training was the positive impact on our culture. It’s not too often an entire team breaks from their day-to-day and learns something new as a team. The training helped establish bonds and built enthusiasm for our transition to Flutter.
We piloted our first Flutter feature in early 2020 and we haven’t looked back. Over the course of six months, despite also grappling with the global pandemic, we were able to start adding Flutter features to our app and train our entire team to be Flutter experts. Today, just over a year since we fully adopted Flutter, 85% of our app runs in Flutter, with the remaining 15% attributed to a handful of large features that our product team wants to reimagine as part of migrating them. We expect to migrate the last few features and convert from add-to-app to the standard Flutter app template in the first half of 2022.
It can be daunting to replatform an entire app, but our experience shows that it can be done efficiently without much risk. Switching to Flutter was an investment for the future of our mobile app and our engineering team. Now that we are in the process of replatforming with Flutter, we can develop faster, more efficiently, with higher quality features, and ensure the future success of our mobile app.
For Betterment, Flutter is an investment in the future, and we’re already seeing returns on that investment.
Sam Moore is a Principal Engineer at Betterment. Betterment is an online investment company with over $32 billion in assets under management.