Scaling with Flutter — learn from the Nubank engineering team

We talked to the Nubank engineering team about their experience with Flutter, why they decided to use it as their primary technology for cross-platform apps, and how it helps them scale.

A bit over a year ago, Alexandre Freire, Director of Engineering at Nubank wrote an article about Flutter, their early experiences with the platform, and why they decided to use it as their primary technology for cross-platform apps.

After following up with him, Noe Branagan, Engineering Manager for the Flutter core team, and other engineers at Nubank, we’ve decided to give you an overview of how Flutter has helped them scale their app at a hyper-growth fintech company.

Why Flutter?

Nubank is a Brazilian neobank and the largest fintech in Latin America. As the company grew and became 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.

Before deciding on the new technology, the team had 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, Flutter convinced the team, 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.

undefined

A year in — how well does Flutter scale?

Are you still happy with Flutter?

Alexandre Freire: 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.

Since you’ve been using Flutter, is there anything that’s changed in your mobile development process?

Noe Branagan: 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.

Is there something you wish you'd have known back then?

Alexandre: 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 app complexity. Purple marks the ones that we've already migrated, and green ones that we plan to migrate this year:

undefined

In your view, how well does Flutter scale?

Noe: 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.”

undefined

What are the main features that make Flutter such a great fit for your use case?

Noe: 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 l10n. We could also create a tool to dynamically deliver new content to our app: 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.

Is there anything else to consider when migrating an app to Flutter?

Alexandre: 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 translations, 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 native, React Native, Flutter state. Hopefully, when we finish the migration we'll be able to simplify this ecosystem.

Marcelo Theodoro: 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.”

--

If you're interested in this challenge and would like to join Nubank on their journey to liberate 100 million customers from complexity by empowering them to own their financial lives, check out their open positions.


If you'd like to learn more about building better mobile apps in the heavily regulated finance and banking space, download our latest report, Mobile product success in finance and banking, 2022 or sign up for our upcoming webinar How to win in mobile finance: A panel discussion.

Get Started for free

Start building now, choose a plan later.

Sign Up

Get started for free

Start building now, choose a plan later.