What's new in Flutter v1.9?
Flutter creates a faster development experience that allows unifying the UI design across platforms, by integrating directly with Android Studio or other development environments. The latest stable release from Google Flutter is Flutter v1.9 alongside Dart 2.5, and it is the biggest update yet, with 1548 Pull Requests, which is merged from about 108 contributors. This release is considered as a significant stage in flutter web support, as it provides the successful integration of Flutter’s web support into the main Flutter repository. The Flutter Web Repository is deflated now and the web support is merged with the main Flutter Repository, which allows developers to write the same code base for mobile, desktop and web. It includes a flag (kIsWeb) to indicate if an app is running on the web.
This release stretches a wide range of updates, from Support for macOS Catalina and iOS 13 to new Dart Language features and some cool new material widgets as well. Now let’s start with the new features of Flutter v1.9.
Supporting macOS Catalina, iOS 13 and Android
As the release of macOS, Catalina is very near, this update makes sure Flutter continues to work smoothly when we migrate to Catalina, iOS 13 and Xcode 11. To ensure this, it provides extra support for the new Xcode build system, enabling 64-bit support throughout the toolchain, and simplifying platform dependencies. However, it is recommended to upgrade to stable Flutter v1.9.1, before upgrading to Catalina.
As the iOS support continues to be a greater priority for Flutter, this update ensures the Flutter apps look great on the latest iPhone release. It includes an iOS 13 scrollbar implementation, that includes long-press, drag-from-right and vibration feedback support, and an update to the CupertinoSwitch widget to match iOS 13.
As an addition to current Android support, this update comes up with a new command, exclusive for plugins and module projects are known as ‘flutter build aar’, which works in a similar way to ‘flutter build apk’ or ‘flutter build app bundle’. By building the plugins as aar the Android Gradle plugin can use Jetifier to translate support libraries into AndroidX libraries for all the plugin’s native code, which reduces the error rate when using AndroidX in apps.
Dart 2.5 Release
As the complete development experience relies on the underlying language, Google also released the Dart 2.5 SDK update. This update includes code completion powered by machine learning (ML), and the dart:ffi foreign function interface (FFI) for calling C code directly from Dart. With ML-based code completion comes in handy when the API list grows too large and too long to explore through alphabetically and with dart:ffi, developers can leverage not only available native APIs on the operating systems where Dart code runs, but also existing cross-platform native libraries written in C. Read more about Flutter and Dart – A quick brief.
ToolChain Improvements
With this update, the new projects default to Swift instead of Objective-C and Kotlin instead of Java for iOS and Android projects respectively. Since most of the packages are written with Swift, making it the default language removes manual work for adding those packages to an app created with the default options. And as Kotlin is now the default language for new projects in Android Studio, it is justifiable to make the language switch for Android. These options are the default for both flutter CLI tool and IntelliJ, Android Studio and VS Code plugins for Flutter, but you can always switch back to Objective-C or Java if you prefer. Flutter error messages have been structured by making them more readable, concise and actionable with this update. To turn on the format, turn on Show Structured Errors for Flutter Framework Issues option on IDE.
New Material Widgets
This update includes ToggleButtons, SelectableText and ColorFiltered as their new widget members to the existing Material Components Family. The ToggleButtons widget wraps a row of ToggleButton Widgets together. It mostly comprises a set of Icon and Text widgets, to give a fully customizable look and behaviour. The SelectableText widget allows displaying any text with a single style, selectable for copying. The ColorFiltered widget is considered as the biggest change in text and accessibility of this release, which enables us to re-colour an entire widget tree accordingly.
Language Support
This update includes support for 24 more new languages.