Google releases Flutter 1.17 and Dart 2.8 stable SDKs for app development
Flutter is a cross-platform programming framework, aiming to solve the woes of developing cross-platform apps without the mess of non-native code. With knowledge of the Dart programming language, a developer can build apps for Android, iOS, web, and desktop with a unified UI look across all. Flutter 1.9 brought macOS and Catalina support in an alpha state, while v1.12 release matured their support past the pre-alpha state. Now, Google is out with a new v1.17 release of Flutter and v2.8 release of Dart, marking them as the first stable releases for Flutter and Dart in 2020.
Last month, Google had announced changes to its release process. The company’s earlier process lacked clarity on when releases would be built, what code would be in it, and so on. Now, Google plans to ship stable releases on a roughly quarterly cycle. This by itself posed a few challenges, as the release infrastructure had to be retooled for the new release process. Now, Flutter 1.17 is being released to the stable channel for developers. Google has closed 6,339 issues since their previous Flutter 1.12 release, and they have closed more bugs than have been opened this year, leading to a net decrease of ~800 issues.
In addition to bug fixes, Flutter 1.17 brings substantial performance improvements, improved support for Metal on iOS, and includes new Material widgets.
Apps built with Flutter 1.17 versus older releases will see a 20-37% speedup for the default navigation case in which there are opaque routes with no transparency. There’s also a considerable improvement in app sizes built with Flutter 1.17. For example, the Flutter Gallery sample is now 8.1MB in 2020 versus 9.6MB at the end of 2019. For memory usage, the 1.17 release brings a 70% memory reduction in fast scrolling through large images.
Metal is Apple’s low-level graphics API that provides nearly direct access to the underlying GPU of iOS devices. Flutter now uses Metal by default when building for supported iOS devices, making Flutter apps run faster. The improved Metal support improves rendering speeds of iOS apps by about 50% on average. On iOS devices that don’t fully support Metal, namely devices with iOS versions lower than 10 and released before the A7 processor, Flutter falls back to OpenGL.
Flutter 1.17 adds support for new Material widgets. There are also updates to existing widgets. For instance, NavigationRail helps developers to add responsive app navigation models to apps and is great for apps that can switch between mobile and desktop form factors. DatePicker and TextSelection overflow widgets have also been updated: DatePicker’s new visuals match the updated Material guidelines and add a new text input mode, while TextSelection now has improved fidelity for iOS and Android when buttons are longer than can be displayed without overflowing. Lastly, Google is also shipping the new Animations Package that provides pre-built animations implementing the new Material motion specification.
Other changes in Flutter 1.17
- Google has completed implementing the Type Scale portion of the 2018 Material Design specification without breaking existing Flutter apps.
- Google Fonts for Flutter v1.0 is also now available. This lets developers experiment with and use any font from fonts.google.com in their app. The developer can decide whether to bundle the font with the APK or whether the user receives the font by downloading it from the API.
- Google has improved the accessibility of Flutter apps with fixes to scrolling, text fields, and other input widgets.
- Google is also preparing to swap out the current version of Dart DevTools with the new Flutter version. Developers can test this new version by starting DevTools and then clicking the “breaker” icon in the top-right hand corner of DevTools. The biggest improvement in the new Flutter version of Dart DevTools is the new Network tab which shows the network traffic for your Flutter app when you hit the “Record” button.
- Another improvement is an experimental “fast start” option allowing you to start Flutter app debugging up to 70% faster when you’re building an app for Android.
Google is also giving a shoutout to the Superformula team for remaking the entire MGM Resorts Android app in Flutter.
Dart is the programming language used for building apps in Flutter. With the release of the Dart 2.8 SDK, Google is introducing a couple of changes:
- Improvements to the pub client tool, which is used to manage packages downloaded from the pub.dev package repository.
- Google has improved the performance of pub get by adding support for parallel fetching of packages and deferring pub run precompilation.
- Google has also added a new tool (pub outdated) for ensuring package dependencies are kept up-to-date.
- Preparation for Sound null safety, since null references are a common source of application crashes that happen when code attempts to read a variable that has a null value.
- Google is preparing to add support for sound null safety in Dart, which will ensure that all variables expressed hold non-null values.
- Implementing sound null safety is a huge undertaking that will initially cause breaks in the Dart language and libraries. Google wants developers to be aware of these breaking changes and file any issues on their issue tracker.
You can read more about these and other changes in detail in the announcement posts for Flutter 1.17 and Dart 2.8.