Mastering Flutter Development–Our Approach to Building High-Quality Apps

Mastering Flutter Development–Our Approach to Building High-Quality Apps

Marcin Wróblewski

Flutter has taken the development world by storm, allowing developers to build fast, beautiful, and cross-platform apps with a single codebase. Its versatility and efficiency have made it a favorite among developers (including me) and businesses alike. However, as powerful as Flutter is, creating a truly exceptional app requires more than just basic knowledge—it demands following industry best practices and adding extra bits of your experience.

As a leading flutter company, we've witnessed firsthand the transformative power of this technology and managed to hammer out our own approach to building high-quality Flutter apps.

This article demonstrates why our approach to Flutter development stands out and how our carefully crafted template accelerates the development process.

We'll explore the key aspects that make our methodology effective and showcase how our deep understanding of Flutter's ecosystem has enabled us to create a robust, time-saving development framework. We've recreated a popular native iOS app using Flutter, and we'll share our insights, challenges, and solutions from this process.

What is Flutter App Development?

Flutter is an open-source UI software development toolkit created by Google, designed for building natively compiled applications across multiple platforms—including mobile (iOS and Android), web, and desktop—all from a single codebase. It allows developers to create stunning, high-performing apps that look and feel native, while significantly reducing the time and resources required to develop for multiple platforms. It improves developer experience but also offers lot of benefits for companies. Let's have a close look at the key benefits of Flutter development below.

Why Choose Flutter for Your Mobile App Development ?

Flutter is particularly popular because it's faster and more cost-effective than traditional app development. Companies can save time and money by creating one app that works everywhere. Moreover, the apps look and feel native, meaning they don't seem like they're just converted from one platform to another, but genuinely feel like they belong on each type of device. Flutter is great for startups and businesses wanting to quickly launch an app across multiple platforms without spending a fortune.

Flutter has skyrocketed in popularity over the past few years, and for good reason. Here are some of the standout features that make it a top choice for developers and businesses:

  1. Cross-Platform Development
    With Flutter, you write your code once and deploy it across multiple platforms. This saves time, reduces costs, and ensures a consistent user experience across iOS, Android, web, and desktop applications.

  2. Faster Time-to-Market
    Flutter’s hot reload feature allows developers to instantly see changes in the code reflected in the app, enabling faster iteration and development cycles. This is especially useful for fixing bugs or tweaking designs on the fly.

  3. Beautiful, Customizable UI
    Flutter uses a rich library of pre-designed widgets that make it easy to create visually stunning applications. Unlike other frameworks, Flutter doesn’t rely on native components, which means you can achieve complete customization for your app’s look and feel.

  4. High Performance
    Apps built with Flutter are compiled directly into machine code using Dart, Google’s programming language. This ensures smooth animations and fast load times, offering users a native-like performance on any platform.

  5. Strong Community and Ecosystem
    Since its release, Flutter has developed a robust and active developer community. With extensive documentation, open-source plugins, and support from Google, beginners and experienced developers alike can easily find the resources they need.

Flutter app development has many more advantages and use cases–we dedicated two posts to the topic of why it's worth choosing Flutter for mobile development and the second one covering the topic of leveraging Flutter for building online and desktop apps.

Cta image

Monterail's Approach to High-Quality Flutter App

A high-quality app isn’t just one that looks great—it’s one that performs seamlessly, adapts to user needs, and is easy to maintain and scale. Flutter gives you the tools to achieve this, but it’s up to you to use them effectively. By following the best practices below, you’ll avoid common pitfalls like messy codebases, sluggish performance, and unscalable designs. At its core, high-quality Flutter development revolves around three pillars:

  1. Clean Code: Write organized and readable code that is easy to maintain.

  2. Performance: Optimize every aspect of your app to ensure smooth interactions.

  3. User-Centric Design: Build apps that delight users and adapt to their needs.

Besides the basics we naturally apply to Flutter development, we also recommend the following approach that I'll show in practice in a second:

  1. UI Goodies Built into Flutter: We'll explore the rich set of customizable widgets and tools Flutter provides out of the box. From material design components to Cupertino widgets, we'll show you how Flutter makes it easy to create visually appealing and responsive user interfaces.

  2. CI/CD Custom Strategies: We'll share our tried-and-tested continuous integration and continuous deployment (CI/CD) strategies specifically tailored for projects typical for a Flutter agency.

  3. Testing Utilities in Flutter: We'll delve into the powerful testing framework provided by the Flutter developers. You'll discover how to leverage these tools to write comprehensive unit, widget, and integration tests, ensuring your app's reliability and performance.

Recreating the iOS App in Flutter

To show you our approach to Flutter development in practice and to keep things simple, we decided to recreate the iOS Notes app. The app's purpose is simple enough to grasp without much explaining yet it packs a few advanced features and details that will show the strengths of the Flutter framework.

We’ve picked the iOS Notes also for its user base. Users carry a lot of habits and expectations from iOS apps, like the back gesture, page transition animations, and even the app layout. We want to show how Flutter nails the iOS-specific look and feel and still manages to make the Android and Web versions not foreign to its users by unfamiliar app behavior. 

Custom Flutter App Template

For a faster development kick-off, the Monterail Flutter team decided upon a few crucial app aspects and prepared an app template.

The template features:

  1. Internationalization. Apps compete in the global market and supporting users' native language can be a deciding factor for picking our app rather than competition. We start with English, but can easily add any other language support.

  2. Changelog. For easy end-user release note creation, we keep a list of updates made to specific app versions.

  3. Architecture Decision Records (ADR). To keep track of the reasons which lead to key architectural decisions, we record those for further browsing.

  4. Splash screen. Utilities for automatic generation of an app splash screen to replace the standard white screen with the app logo.

  5. CI/CD. Monterail uses GitHub and AppCenter to streamline app integration and delivery, thus the template provides scripts for those platforms to automatically test, build, and deploy the apps.

  6. Bug tracker integration. Monterail uses Sentry as a bug-tracking tool. To accommodate that the template comes with ready-made integration with Sentry. Thanks to BLoC state management, the Sentry plugin can automatically report both UI and logic errors. Also, thanks to BLoC traceability we can easily opt in for detailed breadcrumbs for each error which will speed up bug fixing. We don’t enable enhanced breadcrumbs by default as such a detailed app behavior report probably will contain personal user data which should be noted in the app privacy statement, and we believe that such decisions should be made per-app basis.

  7. Linting and formatting. To maintain a consistent code style we opted for a list of opinionated decisions about equivalent approaches to solve popular problems. This allows for shorter code reviews and easier code changes because the developers rather than decrypting the original author’s intent can just recognize known patterns and evaluate if it’s appropriate for a given problem.

  8. State management. To handle business logic in a testable and maintainable way we’ve picked BLoC as a state management solution. It allows for robust app logic traceability which is useful both in development and debugging.

  9. Routing. Managing routing for both mobile/desktop and web applications is tricky. Hence we’ve opted for a community-made routing library that supports code generation, thus saving the development time for actually demanding tasks rather than writing and managing boilerplate.

  10. Flavoring. For simple-to-configure app environments, the app configuration is kept outside the codebase with environment variables - those are fed in during the build process.

  11. Caching, persisting data. To securely store user and app data locally we use a high-performance, community-made package wrapped with our helper mixin abstracting repetitive actions to reduce boilerplate.

  12. Testing. To avoid regressions and keep a high codebase quality we test the code at unit, widget, and integration levels.

  13. IDE integration. The team agreed on using Visual Studio Code as an IDE. That’s why the template provides launch configurations and a list of tips on how to configure it to boost productivity.

Also, the template provides a lot of tips about the app and third-party services configuration to speed up development kick-off even more.

Initial Configuration

Developers on any knowledge level can set up the project since the template provides a first steps checklist.

Sneak peek of the steps:

  • Configuring the app metadata - Replacing app id, app name, icon

  • Connecting the bug tracker - Providing the Sentry project id

  • Managing app signing - Creating signing key for Android, steps to generate files for iOS app signing

Ready-made UI Components

One of the many strengths of Flutter is its rich widget gallery. Besides the standard ones for layout and spacing, there are two main widget groups built into Flutter: Cupertino and Material. The first one recreates the look and feel of macOS/iOS native apps and the second one provides a widget ecosystem that supports Material 3 design guidelines.

Cupertino

Flutter provides 20+ high-quality and customizable widgets that perfectly mimic iOS native app components. Look for yourself:

We’ll use this widget set to build our example app.

Although beautiful, the Cupertino widget set is not used as often as the Material set is when building Flutter apps. Its look and feel are macOS/iOS specific and can feel foreign to users of other platforms. The great thing about Flutter’s everything-is-a-widget approach is that we can mix and match Cupertino and Material widgets, so if you like you can just use an iconic iOS picker in your otherwise Material app.

Material

Material widget set is more popular because the Material design itself is thought out to be adjustable to any branding. Also, it’s bigger, at 40+ widgets, thus more robust and useful for more complicated designs.

Robust testing

Following Flutter guiding principles about apps quality, the framework provides built-in testing support, for every feature level - unit, widget and integration.

Tight test library integration with the framework allows Flutter IDE plugin to display an UI for ran tests. Such a UI can speed up the testing process compared to CLI one, and helps make a mental map of test structure.

Unit, widget, bloc

Flutter provides a robust test suite for unit and widget tests. The common thing throughout the Flutter framework is the fact that everything can be built upon by community members. Tests are no exception and thanks to that we can use community-maintained bloc test library which streamlines BLoC modules testing and can be used without any additional test configuration.

Integration

Integration test suite is built into Flutter SDK but has to be explicitly added as a dependency. Integration test code should be stored outside of the default unit and widget test directory (simply test), as those tests are not meant to be run frequently, rather when the app version is a production candidate.

App Demo in Flutter

You know the theory now but there's more! Open the demo app to assess the quality yourself or dive into the code for implementation details.

Demo: https://flutter-notes-d8219.web.app/#/
Code: https://github.com/monterail/flutter-notes 

Flutter is definitely reshaping the landscape of mobile app development, one widget at a time. Cross-platform app development is much easier with its efficient, feature-rich toolkit and I hope this article proved the point. By now, you should have gained a clear understanding of why Flutter might be the perfect solution for your next app project, along with practical knowledge to help you get started. Whether you're considering flutter development services or looking to enhance your existing flutter company practices, you should be able to apply these guidelines to leverage Flutter's full potential.

Marcin Wróblewski  avatar
Marcin Wróblewski
Senior Mobile Developer
Senior Mobile Developer at Monterail – open-source enthusiast, focusing on Dart and Flutter due to their technical excellence