A bit over a year ago, Alexandre Freire wrote an article about how we decided to standardize our mobile app development with Flutter, our early experiences with the platform, and why we decided to use it as our primary technology for cross-platform apps.
In a recent interview with Nóra Bézi from Bitrise, Alexandre, along with Noe Branagan, Engineering Manager for Nubank’s Flutter Core team, and other engineers at Nubank, gives you an overview of how Flutter has helped us scale our app development to support our hyper-growth.
As Nubank grew to become the largest independent digital bank outside of Asia, developing new products beyond the credit card became a priority and new teams had to figure out a way of rapidly shipping high-quality apps.
In order to commit to a single technology, the team evaluated the options against a well-defined set of priorities based on these five factors:
1. Developer experience: Will it enable developers to deliver value and be more productive?
2. Long-term viability: Will the platform be supported by its creators in the long run?
3. No platform specialization: Does the code look and behave the same on Android and iOS, with a low occurrence of OS-specific problems?
4. Incremental abstraction cost: How hard will it be to extend the platform and add new components?
5. Non-linear abstraction risk: Would they need to make non-trivial changes across the entire codebase to support new components?
After gathering evidence, the team decided to adopt Flutter, thanks to its excellent testing capabilities, such as built-in testing infrastructure for Unit, Integration, and End-to-End tests without the need for rendering to the screen. Overall, — compared to other options — they also found the Flutter development experience to be superior, with better hot reload capabilities, robust official documentation, and a more stable API.
A year in — how well does Flutter scale?
Nóra: Are you still happy with Flutter?
Alexandre Freire, Director of Engineering: We love Flutter at Nubank. It has become 100% part of our culture when we talk about mobile development. We are also experimenting with Flutter web as it has shown many advantages when using it to improve our developer experience. We’ve made a lot of strategic decisions in our product team that have impacted our velocity and efficiency and given the opportunity to more engineers to collaborate in our codebase by sharing one language. We’ve been amazed at how easily our teams have adopted the technology and all the new features developed using Flutter. We are getting more experienced in Dart — it has become part of our arsenal for creating new tools for mobile development, like the CLI we use for mobile developers to work in our monorepo.
Nóra: Since you’ve been using Flutter, is there anything that’s changed in your mobile development process?
Noe Branagan, Engineering Manager: Since we decided to adopt Flutter, we’ve adopted an experimental internal developer tool using Flutter Desktop to speed up our development even more. It reduces laptop battery usage by skipping emulators and helps with quick testing in different device dimensions. Our mobile infrastructure and development efficiency has been constantly improved with Flutter, Dart, and with the many new, dev-only features introduced over the past year.
Nóra: Is there something you wish you’d have known back then?
Bruno Tavares, Engineering Manager: I think we were a bit naive regarding our capacity to migrate such a big and complex app that offers complete support for four different products. We are still halfway through: our app real estate is not yet 100% Flutter. We’ve recently finalized a complete map of ownership of modules to teams and started tracking plans to finish the migration. We’re aligning the company around the technical objective of finishing the migration. We’re also facing hard prioritization decisions, especially in flows and screens that work very well in their current state (native Objective-C, Swift, Java, Kotlin, or React Native) for which there are no near-future update plans.
The map below shows all app flows and screens, with the size signifying module complexity. Purple marks the ones that we’ve already migrated, and green ones that we plan to migrate this year:
Nóra: In your view, how well does Flutter scale?
Noe Branagan, Engineering Manager: Our engineering team is still scaling as a result of Nubank’s hyper-growth — we’re always hiring. This also means that we need to increase the frequency of shipping new features to customers, which requires more capacity and resources, as well. Having Flutter as our main technology has significantly reduced the barrier, allowing new engineers to be able to contribute to our App within days after being onboarded. In terms of efficiency, we have tremendously improved our build time; the merge success rate is 30% better compared to native, with Flutter PRs taking 9.9 minutes to merge, in comparison to 70.45 minutes overall average on all platforms.
Reinaldo Moreira, Mobile Engineer: “Flutter enabled us to launch Life Insurance in just 3 months. Before using the framework, developing and launching a new product would take several months or even a year. Using Flutter helped us accelerate our development for both platforms and the tools created from our mobile platform have also made a huge difference. I can’t think of a scenario of how this feature could have been done without using Flutter.”
Nóra: What are the main features that make Flutter such a great fit for your use case?
Lindsey Bleimes, VP of Engineering: It provides more consistency in how we do product development. We have our own design system, in which product teams can extend and customize their UI components. It also offers better backend driven tooling like the ‘hot reload’ function and better support for localization. We created a tool to dynamically deliver new content to our app for example: we can now manage localization without the need to release a new version of the app or sacrificing performance. Using Flutter has helped us create better infrastructure for observability, send alerts directly to the responsible team, measure the app size by feature or package, and correlate more metrics with other systems.
Marcelo Theodoro, Engineering Manager: The main benefit was that even non-mobile engineers were becoming productive in just a few weeks, due to Flutter’s fast learning curve. With the adoption by multiple product teams, we all noticed some great new practices arising, and started standardizing our codebases.
Nóra: Is there anything else to consider when migrating an app to Flutter?
Alexandre Freire, Director of Engineering: It’s worth noting that, apart from the app code itself, this migration involved a lot of tooling and support. We created a service to deal with all the app copy and localization, since we are operating in Brazil and Mexico and have already announced our operations in Colombia. We also built development tooling like the CLI written in Dart and adapted our build, testing, and continuous deployment pipelines, using mostly in-house solutions. We had to adapt to this reality of having an app that exists in a mixed state (native, React Native, and Flutter). Hopefully, when we finish the migration we’ll be able to simplify this ecosystem.
Marcelo Theodoro, Engineering Manager: It’s not all roses. Being early adopters, it didn’t take long before we experienced some issues when integrating with legacy native parts of the app. The key learning here was that having a platform team focused on supporting the product teams is crucial to solving these types of bugs and some of the complex performance issues. And to prevent the app from becoming like Frankenstein’s monster, we found it important to provide widespread training to all teams.”