Flutter Apps, Cross-Platform App Development, Flutter 2.2, Type Aliases, COVID-19, Flutter Desktop Updates, Flutter Web Updates, Flutter DevTools, Application Building

Everything You Need to Know About Flutter 2.2

Oct 18, 2021

Blogger-Picture
Prakunj Chaudhary
Software Developer
Blog-Banner

Google has recently announced the launch of Flutter 2.2, the latest version of the cross-platform app development framework that was originally launched back in December 2018. The latest release has several important features as well as improvements that make it easy for mobile app developers to monetize their apps. This blog post will feature everything you need to know about Flutter 2.2, so read on to know more.

The framework was launched the Google I/O event which took place a few days ago while according to Tim Sneath, the Director of Product Management of Flutter, the latest version is by far the best version of Flutter that allows mobile app monetization by introducing in-app purchases, payments as well as ads. Apart from this, the mobile app developers are now capable of implementing new capabilities in their mobile apps by connecting to the cloud as well as other APIs.

In addition to this, the latest version Flutter 2.2 makes way for desktop improvements as well as increase the efficiency and performance of apps, remove errors and reduce the package size.

Here is everything you need to know about Flutter 2.2, its features and improvements:

Dart 2.13 Announced

The Dart 2.13 version has been announced in addition to other improvements to the framework. The Dart 2.13 now supports Type Aliases, has better FFI, supports null safety as well as gets Docker Support.

Type Aliases

Rename Classes Example:

typedef OldClassName = NewClassName;

Type Aliases for Classes Example:

typedef StringList = List;

Dart FFI (Foreign Function Interface)

The new version of the Dart FFI has been implemented with a few new features. It is basically a mechanism to call the C code while the new features now allow the user to directly wrap the inline array in the Dart.

Example:

class StructInlineArray extends Struct {
@Array(8)
external Array arr;

In addition to this, the Dart FFI now supports Packed Structs which allows the developer to lower the overall memory consumption by omitting padding, particularly in the platform-specific environment.

Example:

@Packed(4)
class TASKDIALOGCONFIG extends Struct {
@Uint32()
external int cbSize;
@IntPtr()
external int hwndParent;
@IntPtr()
external int hInstance;
@Uint32()
external int dwFlags;
...
}

Apart from this, the Dart 2.13 has been awarded a number of performance changes that reduce the total space which has been occupied by the metadata of the program.

Null Safety Update

The latest Flutter 2.2 version that has been launched now allows the developers to create projects with null safety by default. It now protects the apps to crash mid code while also offering safety against null reference exceptions.

Ads SDK

The New ads SDK now supports banner formats that are customizable. Apart from this, the new ads SDK also features a new payment plugin that has been built-in support of the Google Pay team. It further allows the developers to take payments for the physical goods on both iOS and Android. The new update now also features an updated in-app purchases plugin.

Flutter Desktop Updates

The latest update allows the users to customize the keystrokes that are currently associated with text actions. For instance, the new update allows the user to use the “Enter” key for sending the text while using it with Ctrl to add a new line in the code.

Apart from this, the developers now do not have to add the scrollbar manually whenever the text exceeds the screen limit. The new version adds itself whenever that is the case. The ScrollBarTheme and ScrollBehavior can be used for customizing the scrollbar through the app and customize it for specific screens respectively.

Coming to the deferred components, the Flutter 2.2 version only allows it for Android while the iOS platforms are still to support the feature.

The DevTools suite has also been updated with a bunch of new features. They now allow the developers to understand the memory allocation inside the apps. It will come in handy whenever there is a memory leak inside the code. Apart from this, the third-party tools extensions are also supported. The developers can further add custom messages in the memory timeline with this additional feature.

Flutter Web Updates

The Flutter 2.2 has introduced a variety of new improvements for the Flutter web. One of the main improvements is fixing the double-downloading of main.dart.js. Before the update, the developer had to download the update and refresh the page multiple times to check out the changes. The new version imparts the changes to the page without needing to refresh the screen. In addition to this, the layout explorer for Flutter Web Apps is now supported by the Flutter DevTools.


Blogger-Picture
Prakunj Chaudhary
Software Developer