Flutter Engage – Everything you need to know about Flutter 2.0
Google launched the second instalment of Flutter, Flutter 2.0 in the event Flutter Engage held on 3rd March 2021. Flutter 2.0 has been in the news as there were many speculations by renowned experts who called it a historic launch by Google. This new upgrade comes with a number of features and fixes which are remarkable in their own way. Earlier this year, we posted a blog about the most important Flutter app development tools in 2021 which still holds true for Flutter 2.0.
Prior to this, developers relied on Flutter for Android and iOS app development only. However, with the most recent update, it has expanded the mobile app development services to various other platforms like mac, windows, Linux and more. Moreover, developers can also use Flutter for web app development to be run on a web browser.
This gave a huge relief to the app developers around the world because it is cumbersome to work on multiple platforms for the same project as the logic has to be changed based on the system requirements. Let us find out what is new with Flutter 2.0 in detail.
Web
The most intriguing part of release 2.0 is Flutter’s extended support for the web. Flutter has extended code reusability to the next phase by providing web support. The release is very important because it has shifted its strategy from document-centric to the app-centric framework. Due to this reason, the web has turned out to be a great addition for Flutter app developers to build on.
By tapping in to the strength of web platforms, Flutter has built a foundation for developers to work on interactive web applications. Moreover, it has improved the platform with APIs to build flexible and interactive 2D and 3D graphics.
Along with the HTML renderer, Flutter 2.0 has also introduced a Canvas-Kit based renderer. Additionally, it also includes a Link widget which allows developers to offer a web-app like feel in the browser.
Desktop
Just like the web, Flutter has also offered its support to Desktop applications. Now, Flutter allows developers to provide a native-like experience on each of its platforms. This experience consists of many things like text selection pivot points, built-in context menu, mouse dragging and more.
Version 2.0 allows the developers to halt the keyboard events even once they have been commenced. Moreover, developers can shift items in the ReorderableListView widget effortlessly.
The revised scrollbar widget is a new inclusion that provides great interactiveness in the desktop app as developers can work with their thumb. Moreover, the desktop-flutter app displays page and down tracks. Additionally, the mouse hovers in the scroll bar. In the end, they can customise the app as they wish with the new ScrollbarTheme class.
The new Flutter update also allows developers to smooth resizing for macOS and Windows. The Flutter community has now moved ahead in terms of production-quality release and hence you can foresee support for multiple things like native-like text editing, native-level top menus and accessibility support.
Null Safety
Null safety is a great inclusion to the Dart language. Firstly, it makes every variable a non-nullable type unless you specifically mention that it can be null. This is extremely useful because it automatically makes your existing code non-nullable. But, such an instrumental change has a lasting effect on the current codebase as it is a major reason in how things function. This might be the reason why your code might not compile when you use the new feature. The Flutter team was mindful of this and hence made provisions for migration to null safety.
Dart team has agreed not to enable null safety by default and it will take place when the entire ecosystem has been shifted successfully. If you would like to use null safety now, you can use ‘dart migrate’ and check the guide for more information. The compiler can run much faster if it doesn’t need to check for nulls all over the code. This allows the app to run faster than ever before.
Google Mobile Ads
Flutter 2.0 release now comes with the Google Mobile Ads SDK beta version. This allows developers to add native ads and inline banners along with the current overlay formats. Developers can simply customise ads by using Admob and Ad Manager.
Platform Specific Apps
As it has already been discussed above that Flutter 2.0 supports Linux, macOS and Windows too. Still, many developers have this question on how to write an app that can automatically adapt itself to various types of screens (small, medium and large). The screen size is not the only factor but developers also think about mobile/web or desktop versions.
AutoComplete and ScaffoldMessenger
With the release of Flutter 2.0,developers now have access to two novel widgets like Autocomplete and ScaffoldMessenger. If we discuss Autocomplete, then it displays the minimal functionality needed to get an auto-complete feature into your Flutter app.
Autocomplete was demanded for a long time by developers to include auto-complete features in your native apps developed using Flutter. On the other hand, ScaffoldMessenger allows developers to create SnackBar for the action between the scaffold transitions.
Conclusion
We believe that this blog has done well to help you understand the nuances of Flutter 2.0 release. Though, you must understand that there have been various inclusions in the Flutter 2.0 release note and you must take help of an expert to understand it better. If you are thinking to hire Flutter app developers for your next project then you can contact Nimblechapps, an innovative mobile app development company. If you have any questions, you can let us know in the comments below.
Dhruvil is a Writer & Marketeer for Nimblechapps, joining December 2014, based out of Sydney, Australia. He has worked briefly as a Branding and Digital Marketing Manager before moving to Australia. At Nimblechapps, he worked on Social Media Marketing, Branding, Email Marketing and Blogging. Dhruvil studies Business at University of Western Sydney, and also handles Operations for the company in Australia.