This article is more than 1 year old
Dart 2.8 is out with a Flutter as Google claims to have solved the cross-platform dev puzzle
Material improvements in strategic framework for mobile, web and, tentatively, desktop apps
Google's first 2020 update of its cross-platform development toolkit has brought Flutter up to version 1.17 and the associated Dart language to 2.8.
There are countless cross-platform libraries and frameworks out there, but a few things distinguish Flutter. First, it is entirely focused on GUI applications, primarily Android and iOS but with support for web applications in progress, and desktop applications in early preview. You can compile Flutter code to a native macOS application (this project is alpha status), or on Windows and Linux in "early technical preview".
Next, Flutter is a strategic project for Google, and turns up not only in the context of Android but also in Fuchsia, a forthcoming new operating system. It is not clear yet what role Google plans for Fuchsia, but you can think of Flutter as a handy way to hedge your bets in case it turns out to be a successor to Android. If Google can persuade developers to target Flutter, rather than Android or iOS or even the web, then it can easily migrate them to a new platform like Fuchsia.
Dart 2.8 is not a huge update. The team is working on a key feature called null safety, which is intended to address the "billion-dollar mistake" of null references, but work on this is not yet complete. Dart 2.8 does include a "set of small breaking changes" which "lay the groundwork for our first version of the null safety feature". These are edge cases and library changes and most code should continue to run the same. In addition, Dart 2.8 has improved dependency management, with a new tool for finding out-of-date dependencies, called pub outdated, and parallel fetching of packages using pub get, improving performance.
Flutter 1.17 is more interesting. The team is claiming some marked performance improvements:
- 20-37 per cent speedup for navigation in the default case
- Up to 40 per cent reduction in CPU/GPU usage for animations on iOS
- Reduced application size typically of around 18.5 per cent
- 70 per cent memory reduction scrolling through large images
- Default use of Apple's Metal graphics API, improving rendering time by around 50 per cent on iOS
Next, Google has updated its Material widgets, Material being Google's design theme, with a new NavigationRail for responsive applications, and an updated DatePicker. There is also a new animations package (not technically part of Flutter 1.17), which implements Material motion
There is also updated text theming, which along with support for Google Fonts gives developers an easy way to get a wide range of fonts and text styles while conforming to the Material design guidelines. Fonts can be retrieved dynamically or embedded in the application package, for peace of mind in case Google's Font service becomes unavailable. Accessibility features have been improved, and there are internationalisation fixes.
The Dart DevTools are being revised, and if you opt into the latest pre-release you can use new features including a network traffic inspection tool that will help debug the tricky state conditions that can occur, or explain why the data sent or received from your backend service is not what you expected.
There are a few breaking changes in Flutter 1.17 and the AndroidX libraries are now required for new projects, though existing applications that do not use AndroidX can still be compiled (and there must be hacky workarounds if necessary).
"Since the Dart-based Flutter went 1.0... the language has jumped all the way up to #24 in the latest rankings," said the analyst's Stephen O'Grady. While that does not make Dart a major contender, it shows that Google is having some success in establishing this platform.
It is no coincidence that ex-Microsofties such as Tim Sneath and Chris Sells have turned up as Google product managers working on Flutter and Dart. Google would like nothing better than to provide an alternative for developers frustrated with Microsoft's constant changes of direction when it comes to GUI frameworks.
Flutter is still not altogether mature, but if Google keeps going with its commitment it looks promising. "Flutter brings with it the promise of solving a problem that our industry has wrestled with for decades: how can you build great apps from a single source code base across multiple platforms?... We think we're on a good path to answer that question," said Sells in a preview press release.
The caveat is that although open source, as a Google product the platform will nudge you towards using Google services. It is likely this, and the desire to improve the user experience on both Android and in web applications, that drives the company's investment in the Dart/Flutter platform. ®