Introduction to Flutter

Aug 11, 2023 | Events

Flutter is becoming one of the most popular cross-platform frameworks. Its number of users is steadily increasing and it is getting more features that make development easier and give users more options. In this blog, I will try to give basic information about using Flutter and starting to develop in it.

Since the beginning of using cross-platform technologies, there has been discussion whether it is better to use native approach, or cross-platform. That is not a topic of this blog, since it depends on so many factors which cannot be generalized and determined without knowing project requirements. Instead, benefits and weak points of Flutter will be discussed and that will hopefully give enough information for making decision easier.

Here are some benefits which should be considered if you’re thinking of using cross-platform for your project.

 

Faster development cycle
Since app on all supported platforms uses the same codebase, it takes less time to make a feature for all platforms. Bugs can also be fixed on multiple platforms simultaneously

Cost-effectiveness
Developing a single cross-platform app can save significant development costs compared to building separate native apps for each platform (iOS and Android).

Consistent user experience
By using the same code on all platforms, it is very easy to provide the same look and feel for app on all supported devices.

Community support and resources
Popular cross-platform frameworks have large and very active communities. For Flutter, a big number of popular and commonly used packages, such as Provider, Riverpod or Bloc, are made and maintained by individuals and their groups, allowing growth, innovation and extreme ease of communication.

Lower learning curve
Many cross-platform frameworks use familiar or existing programming languages, so it is easier to adapt and get started. Also, the switch from native to cross-platform is very easy since the concepts are pretty much the same.

Flutter setup

Flutter is fairly simple to install. The official documentation has all the steps covered and it can be found here.

There are a few tips and tricks worth mentioning, that I found useful in setting up my environment:

I use IntelliJ IDEA for development. It is similar to Android studio in its looks and features and it has a more comprehensive set of tools for Flutter development and code and app analysis. I have also used VS Code for Flutter development, and while it was perfectly fine, it does feel like some options aren’t as readily available and visible as in IntelliJIdea.

Use flutter doctor and its verbose version flutter doctor -v to help find problems with your setup. Output of this command will not only give problems, but also warnings for things that are not essential, but you might need them. Also, when your code “suddenly” stops working, the first step should be running flutter doctor.

Be careful with updates for Android Studio and xCode. Updating them as soon as a new version comes out often creates bugs in app because the Flutter version can be incompatible with new development environments, or there has been some change in project configuration. Common issues are also cache not being cleaned and keeping old versions of dependencies, Flutter plugins deprecated versions, and need for manual update of Cocoa Pods.

Don’t forget to test on all platforms your app is supported on! Also, don’t forget that your app supports multiple versions of the operating system and needs to look and work fine on all of them!

When setting up environment variables, or installing new tools for command line/terminal, don’t forget to restart it, so the changes can be applied!

Conclusion

Flutter is an extremely good option for cross-platform development. It is modern, fast, has a strong community and is in constant development. It does have some weak points, but they are being handled, and it can be expected that Flutter will only grow in future, both in number of users and in quality and number of functionalities it offers.

Cross-platform development does have some weak spots, which are not obvious at first, but can impact quality and invested time for the app. For Flutter, the main weak spot is its newness. This shows in a few ways, main ones being lack of established best practices and presence of many viable but imperfect solutions for certain common tasks and problems.

For apps that are not complicated, or do not require complex computation, this is not a problem, and they will be working fine. When working on a more complex app, setting the architecture and choosing an approach to things such as state management, error handling, testing and so on, takes a bit more time than for i.e. Android, where you have very well documented architecture examples for many kinds of applications.

Another important weak spot is handling features that use native components, such as camera, location and permissions. In those cases, knowledge of native implementation becomes needed, and since plugins do not have all native features supported, it takes more time to develop complex features.

So far, Flutter shows promise and has a lot to offer for mobile app development. The community is growing, Flutter is getting more features, and its problems are slowly but steadily being solved.