The Pros and Cons of Using Flutter for Android App Development

  Programming

Flutter is a rather unique app development framework from Google. It lets you use the Dart programming language–a very easy language for anyone who knows Java already–to create apps whose performance is identical to that of native apps. Should you use it develop your next big app? Well, to help you make that decision, let me talk about some of its pros and cons now.

The Pros

  • With Flutter, you can develop Android apps quickly, even on a relatively low-end machine. Last month, I was travelling and was carrying an old netbook with me, which has just 2GB of RAM and a dual core processor. Using the latest version of Android Studio on it is almost impossible. So, when one of my clients asked me to build a simple Android app for them, I decided to use Flutter. It was a good decision because I was able to build the app in no time using the Flutter CLI and vi as a code editor.

  • Flutter has a hot reload feature that let’s you instantly see the results of your code changes. This is much like Android Studio’s Instant Run feature, but considerably faster. This obviously lets you experiment with the looks of your app more freely.

  • It is a reactive framework. That means, when it’s used correctly, you won’t have worry about updating the contents of your user interface manually. Just update the variables in your state, and the UI will reflect the changes automatically.

  • With Flutter, you don’t have to deal with XML files for creating your layouts. You define both the looks and functionality of your app using Dart alone. What’s more, you can take advantage of a number of modern layout widgets that almost work like templates. For instance, you can use a ListTile widget to easily create a list item containing an icon and one, two, or three lines of text. Or you could use the Scaffold widget to define the overall structure of your app, including the app bar, the drawer, and the bottom sheets.

  • Flutter apps can easily take advantage of a growing collection of Dart libraries. Thanks to those libraries, performing most tasks in Flutter requires very few lines of code.

  • Lastly, Flutter allows you to develop apps for both Android and iOS. It has widgets whose looks conform to the design guidelines of both the platforms. In other words, you can use Material Design widgets in your Android apps and Cupertino widgets for iOS apps.

The Cons

  • Flutter is still an alpha release. I, for one, didn’t find anything unstable about it. But, if you plan to use it in a long-term project, it would be prudent to think twice before you choose Flutter.

  • Currently, Flutter doesn’t have a WebView widget. So, you can’t embed a WebView in your app’s view heirarchy. As of v0.0.17, if you want to display a web page in your app, you must use a plugin that launches a new activity containing just a WebView displaying your desired URL.

  • It will take you a few days to become comfortable with Flutter’s layouts. Adding paddings, margins, and setting other layout attributes is not very intuitive at first. Additionally, you’ll have to spend time understanding box constraints.

  • The APK of a Flutter app will almost always be considerably larger than that of a native app. I have found that even trivial Flutter apps are at least 6-7 MB in size.

Conclusion

Flutter is really worth a try. From my experiences, I can say that no other cross-platform framework available today can match its performance. You’ll be amazed at how responsive and smooth its scrolling and animations are. And if you want to see how a real Flutter app behaves, I suggest you try the Plebeian Reddit client, an app I created recently.

If you found this article useful, please share it with your friends and colleagues!